beforeunloadHandler(e) {//根據(jù)事件進(jìn)行操作進(jìn)行操作 console.log(e) console.log('瀏覽器刷新') }, }, destroyed () {//進(jìn)行監(jiān)聽(tīng)銷毀 window.removeEventListener('beforeunload', e =>this.beforeunloadHandler(e)) }, 監(jiān)聽(tīng)刷新事件如何寫? 在網(wǎng)上找了很多都不能用,用下方這串代碼,親測(cè)有用,直接放在mount...
www.dbjr.com.cn/article/2455...htm 2025-5-31