vue 禁止浏览器自带的后退功能

Posted on 2020-07-01 17:07  凡凡0410  阅读(1310)  评论(0编辑  收藏  举报
mounted(){
       history.pushState(null, null, document.URL);
       window.addEventListener('popstate', function () {
         history.pushState(null, null, document.URL);
       });
   }

 

Copyright © 2024 凡凡0410
Powered by .NET 9.0 on Kubernetes