Answer the question
In order to leave comments, you need to log in
How to update data by router.push()?
Hello, the component does
$router.push({
path: '/selectId',
query: {id: id },
})
mounted() {
if (this.$route.id)
this.id = this.$route.query.id;
},
Answer the question
In order to leave comments, you need to log in
watch: {
"$route.query.id": function (value) {
// do something
this.id = value;
}
}
mounted() {
if (this.$ route.query ? .id)
this.id = this.$route.query.id;
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question