0👍
Deep watch
should work on Vuex store as well.
import { mapState, mapMutations } from 'vuex';
export default {
computed: {
...mapState([
'allCategory'
])
},
methods: {
...mapMutations([
'CHANGE_ALL_CATEGORY'
]),
toggleTab(index, isShow) {
// ...some action
this.CHANGE_ALL_CATEGORY(allCategory);
},
},
watch: {
allCategory: {
handler(val) {
this.CHANGE_ALL_CATEGORY(val);
},
deep: true
}
}
}
Source:stackexchange.com