computed: {
...mapGetters(['getNoticeNum']),
msgNum: {
get () {
return this.getNoticeNum
},
set (val) {
this.setNoticeNum(val)
}
}
},
// watch 监听msgNum的变化 实际就是在监听getNoticeNum
watch: {
msgNum (newVal, oldVal) {
console.log('newVal', newVal)
}
},