if you want to listen to the physical return key of a mobile phone in each sub-page to specify a route jump, instead of performing a step-by-step jump through history, you can install the listening method on the lifecycle mounted of each sub-page
mounted () {
this.addPopState();
},
methods: {
addPopState() {
window.addEventListener("popstate",function(){})//popstate
}
}
but the problem is that the same event is bound in multiple pages, resulting in being overwritten. Is there any good solution?
kneel down and thank you!