在Vue页面中监听Vuex数据变化
computed: {
listenData() {
return this.$store.state.user.data
}
},
watch: {
listenData(newVal, oldVal) {
// 此处处理逻辑
this.isWork = this.$store.state.user.data
}
}
在Vue页面中监听Vuex数据变化
computed: {
listenData() {
return this.$store.state.user.data
}
},
watch: {
listenData(newVal, oldVal) {
// 此处处理逻辑
this.isWork = this.$store.state.user.data
}
}
打赏作者