<script>
import {reactive} from 'vue'
export default{
setup(){
let data=reactive({
mes:0
});
const add=()=>{
//console.log('//1555');
data.mes++;
console.log(data.mes)
}
return {
data,
add,
}
}
}
</script>
<template>
<div id="as">
{{data.mes}}
</div>
<button @click="add">+</button>
</template>
<style scoped>
</style>
注意 data.mes++ 不用value
文章来自 www.96net.com.cn