import { reactive, watch } from 'vue'
const obj = reactive({
name:`demo`
})
watch(() => obj.name, (newName) => {
console.log(newName)
})
Vue3 watch监听reactive中的属性变化
最新推荐文章于 2024-06-02 09:41:29 发布
import { reactive, watch } from 'vue'
const obj = reactive({
name:`demo`
})
watch(() => obj.name, (newName) => {
console.log(newName)
})