Answer the question
In order to leave comments, you need to log in
How to catch Android back button click in Vue.js app?
Let's say the site opened on a smartphone for Android, the user opened the side menu. When you press the back button, it will not exit the side menu, but go to the previous page. How to catch a click on the back button?
UPD:
As it turned out, this can be done, but not through VueRouter. At least I have not yet figured out how to use it to do what I needed.
There are two options for solving the browser history problem:
1. Change the routing plugin
2. Manually change the browser history:
https://developer.mozilla.org/ru/docs/Web/API/History
https://developer.mozilla. org/en-US/docs/Web/API/H...
https://developer.mozilla.org/en-US/docs/Web/API/W...
I did this by crossing Vuex, an event bus, and just changing the history.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question