I am trying to implement a warning right before user exits the application. It's not on browser closing or tab closing. I want to implement this when user keep tapping on back button until app is about to exit. Please let me know how to do this. I am using Vue2 with composition api plugin. Highly appreciate your help. Thanks !
I already tried below in App.vue. Didn't work
setup() {
window.onbeforeunload = function () {
confirm('Are you sure you want to close the window?')
}
}