Answer the question
In order to leave comments, you need to log in
How to use query in Vue?
I am, for example, on /filter, I change something in the filters and it redirects me:
created() {
this.$store.watch(
(state) => (state.filter.settings),
() => {
$router.push({name: "planner", query: {
"color": this.settings.color
}})
this.$store.dispatch('filter/GET')
},
{
deep:true
})
},
beforeRouteEnter(to,from,next) {
$router.query = to.query
next()
},
Answer the question
In order to leave comments, you need to log in
Why not pass an argument to the action?
this.$store.dispatch('filter/GET', {query: this.$route.query})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question