VUEブラウザリターン機能を無効にします

1  // 引入JQ 
2搭載(){ // 看好周期
3      disableBrowserBack()。
4      history.pushState(NULLNULL 、document.URL)。
5      あれば(window.history && window.history.pushState){
 6          $(ウィンドウ).on( 'popstate'、関数() 
 7              window.history.pushState( 'フォワード'、NULL、 '' );
 8              window.history .forward(1 );
 9          })。
10      }
 11      //
 12     window.history.pushState( 'フォワード'、NULL、 '');   //は、IE内の2つのライン持っている必要が
13である      window.history.forward(1 );
 14 }、

 

または公共のJSに言及

util.js

1つのインポート"@ / XB-シェア/ API / jqueryの-1.11.3.min.js" 2   
3 disableBrowserBack CONST輸出=(パラメータ)=> {
 4      リターン関数(){
 5          history.pushState(NULLNULL 、document.URL);
 6          場合(window.history && window.history.pushState){
 7              $(ウィンドウ).on( 'popstate'、関数(){
 8                  window.history.pushState( 'フォワード'、NULL、 '' );
 9                  window.history.forward(1 )、
 10             });
11          }
 12          //
 13          window.history.pushState( 'フォワード'、NULL、 '' )。
14          window.history.forward(1 )。
15      })()
 16 }。

ページの参照

1 "../../xb-share/util/util"からインポート{disableBrowserBack} 2  
3  
4  (){搭載
 5      disableBrowserBack()
 6 }、

その上

おすすめ

転載: www.cnblogs.com/xiaozhu-zhu/p/11984056.html