N
N
Nik_Set_72018-05-15 16:48:35
Android
Nik_Set_7, 2018-05-15 16:48:35

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

1 answer(s)
R
Roman Kitaev, 2018-05-15
@deliro

https://router.vuejs.org/en/advanced/navigation-gu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question