[Vuejs]-Issue with accessing this.$router.params in VueRouter

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();
},

Leave a comment