vue项目中处理浏览器后退问题

阻止某一个界面不能使用浏览器的后台按钮的方法
activated () {
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
      history.pushState(null, null, document.URL);
    });
}

猜你喜欢

转载自www.cnblogs.com/yn-cn/p/12766988.html