Is there a way to trigger a function after the contents in <router-view/>
within App.vue
have been updated following a route change? I attempted using the updated()
lifecycle hook, but the function is not being executed.
Interestingly, the function does get called when there is a modification in the state outside of <router-view />
within App.vue
. Is there a specific way to ensure that the function is invoked upon changes within <router-view />
?
Below is an example of the updated hook's code:
updated() {
console.log("changed");
setTimeout(function () {
console.log("in timeout");
store.dispatch("clearGeneralState");
}, 5000);
},