-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Labels
Description
What problem does this feature solve?
I want execute one function in component after each routing (enter route, reused in the new route)
What does the proposed API look like?
variant 1:
beforeRouteUpdate (to, from, next) {
console.log('page category beforeRouteUpdate');
next(() => {
// this don't calling
console.log('page category beforeRouteUpdate next');
this.$store.dispatch('catalog/exec');
});
},
variant 2: add hook named "afterRouteUpdate" that will calling after we enter in route and after each time we navigating in this route (foo/2 -> foo/3)