Vue snooping browser refresh, unable to pop up box

Vue listens to the browser to refresh and cannot pop up. The code is as follows:
mounted () {
window.addEventListener ("beforeunload", e = > this.beforeunloadHandler (e))
}
destroyed () {
window.removeEventListener (" beforeunload", e = > this.beforeunloadHandler (e))
}
methods: {
beforeunloadHandler (e) {
confirm ("whether to leave")
}
}

Oct.14,2021

confirm and alert will not be executed in this event, see https://developer.mozilla.org.

since May 25, 2011, the HTML5 specification declares that window.showModalDialog (), window.alert (), window.confirm () window.prompt ().
can be ignored when the following pop-up-related methods are called in the event handler.
window.onbeforeunload = () = > {this.beforeunloadHandler (e)}
/ / where does e come from? It's no use deleting
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea4314-47a7e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea4314-47a7e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?