//在哪个页面禁止,放在那个页面
destroyed() {
window.removeEventListener("popstate", this.disableBrowserBack, false);
},
mounted() {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.disableBrowserBack,false);
},
methods: {
disableBrowserBack() {
history.pushState(null, null, document.URL);
},
}
禁止浏览器后退操作
最新推荐文章于 2023-07-26 10:21:52 发布