0👍
Since your view has already been created, the created
lifecycle hook is not called again.
Vue Router has it’s own lifecycle methods that you can use for this purpose, see Vue Router In-Component Guards
In your case, you want to use
beforeRouteUpdate
.
An example implementation would be:
beforeRouteUpdate(to, from, next) {
console.log(to);
this.activeInstructorSet = to.params.activeInstructorSet;
next();
},
- [Vuejs]-How to write a single piece of code running both on route A (mounted hook) and also when arriving at route A?
- [Vuejs]-Why trying to run Vue.js it does not work properly?
Source:stackexchange.com