4👍
✅
You can subscribe to Vuex mutations and actions: https://vuex.vuejs.org/api/#subscribe
On the created hook of your admin dashboard component, assuming you’re injecting the Vuex store, you could have something like:
created: function() {
this.unsubscribe = this.$store.subscribe((action, state) => {
if (action.type === 'changeWebsite') { // Whatever your action is called
this.updateWebsiteData(action.payload); // Method to update component data
}
});
},
beforeDestroy: function() {
this.unsubscribe();
},
Source:stackexchange.com