Answer the question
In order to leave comments, you need to log in
How to navigate back in vue router?
Good day.
I use routes in vue app.
There is a question how to make transition back when the user presses back in the browser?
if you go to any url and click back, the url changes, but the page remains the same (the component does not change) or is empty.
Answer the question
In order to leave comments, you need to log in
If you are trying to navigate to the same route ( /users/1 > /users/2 ) use the BeforeRouteUpdate hook and update the data in it.
<router-link :to="-1">
<a @click="$router.go(-1)">back</a>
method() {
this.$router.go(-1)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question