E
E
EvgeniySaschenko2019-02-17 18:13:52
Vue.js
EvgeniySaschenko, 2019-02-17 18:13:52

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}`);

How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-02-17
@delphinpro

Actually, vue-router does everything by itself. Manual manipulations with history are superfluous.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question