import {
computed,
watch,
} from 'vue';
const getShowTask = computed(()=>{
//返回的是ref对象
return store.state.监听的字段;
})
watch(getShowTask, (newVal, oldVal) => {
console.log('newVal, oldVal', newVal, oldVal)
}, {immediate:true,deep:true});
vue3监听vuex的数据
最新推荐文章于 2024-06-18 01:28:14 发布