在xx.vue的页面中的script便签内,写入如下代码,就可在浏览器限制返回按钮
window.history.pushState(null, null, window.location.href);
window.addEventListener('popstate', function () {
window.history.forward(-1);
window.history.pushState(null, null, window.location.href);
});