ブラウザの前進後退機能を無効にする
2617 ワード
ブラウザの前進後退機能を無効にしますここではVueを使用します
// main.js
//
window.history.pushState(null, null, window.location.href);
window.addEventListener('popstate', function () {
window.history.forward(-1);
window.history.pushState(null, null, window.location.href);
});
//
window.history.pushState(null, null, window.location.href);