Answer the question
In order to leave comments, you need to log in
Vue.js router - back/forward arrows not working in browser. How to fix?
Hello!
I am developing a site on Vue.js, I ran into a problem - when I try to return to the previous page with the back / forward arrows in the browser, the current page remains (the data in the component does not change).
The url in the browser changes programmatically, when the button is clicked, the following code is executed (When the button is clicked, the url changes and the component data is updated):
this.$router.history.push(`/movie/uid/${chosenMovie.uid}`);
Answer the question
In order to leave comments, you need to log in
Actually, vue-router does everything by itself. Manual manipulations with history are superfluous.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question