监听vuex中数据的变化
代码如下(示例):
data() {
return {
isStop: ''
}
}
computed: {
isPlay() {
return this.$store.state.isPlayMusic;
}
},
watch: {
isPlay(val) {
需要的内容
},
isStop(val) {
内容
}
},
data() {
return {
isStop: ''
}
}
computed: {
isPlay() {
return this.$store.state.isPlayMusic;
}
},
watch: {
isPlay(val) {
需要的内容
},
isStop(val) {
内容
}
},