Answer the question
In order to leave comments, you need to log in
How to update component when $route get parameter update?
using vue 3
in function update get parameter and push route route
let route = {
name : this.$route.name,
path : this.$route.path,
params: this.cloneObject(this.$route.params),
query : this.cloneObject(this.$route.query)
};
route.query.q = this.search;
this.$router.push(route);
beforeRouteEnter (to, from, next) {
next(vm => {
console.log(1);
});
},
beforeRouteUpdate (to, from, next) {
console.log(2);
next();
},
beforeRouteLeave (to, from, next) {
console.log(3);
next();
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question