I upgraded to quasar 0.16 from 0.14 recently, my app has a start page, and auto jumps to different pages based on some conditions, in the target page, I just want exit when back button is pressed, but the route is not “#/”.
I found some behaviors were different with quasar v0.14, In 0.16:
- When using debug version(quasar dev -m cordova -T android), the back button works as expected, but I can not register backbutton event using following code:
mounted () {
if (this.$q.platform.is.cordova) {
document.addEventListener('backbutton', this.onBackButton, false)
}
if (this.$store.getters.isFinished()) {
this.$router.replace('/repo')
}
},
onBackButton method never get fired when I pressed the back button.
- When using release version(quasar build -m cordova -T android), the back button behavior changed, I can not exit app when i am not in ‘#/’ route. seems it’s a new design of quasar 0.15, but why?
And very strange, now the event works, then I can add this code to “fix” the behavior:
onBackButton: function (e) {
e.stopPropagation()
navigator.app.exitApp()
}
But everything works fine in quasar 0.14. Maybe I misunderstood something?