Answer the question
In order to leave comments, you need to log in
How to redirect to the page where router.push Vue is located?
I have a functionality that just resets the project to the initial state and I need to redirect to the same page where you are
this.$router.push({name: this.$router.name, query: {}}) -- > does not work
In this case, I meant that an empty object, as it were, sets the uniqueness of the address and there will be no error
Avoided redundant navigation to current location: "/".
I didn’t find anything on the Russian-English Internet, I have no ideas how to implement such a thing (in theory, a regular redirect to the same page)
Answer the question
In order to leave comments, you need to log in
If you need to reset the query, then $router.replace({query: null}).
And you don't need to go to the same page. Even if you succeeded, it wouldn't do anything: the router caches the components, doesn't render from scratch.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question