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});
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐