久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      react 怎么實(shí)現(xiàn)頁面跳轉(zhuǎn)不記錄

      react實(shí)現(xiàn)頁面跳轉(zhuǎn)不記錄的方法:1、打開相應(yīng)的react文件;2、通過“this.props.history.replace("/home");”方法實(shí)現(xiàn)頁面跳轉(zhuǎn)并清除當(dāng)前頁的歷史記錄即可。

      react 怎么實(shí)現(xiàn)頁面跳轉(zhuǎn)不記錄

      本教程操作環(huán)境:Windows10系統(tǒng)、react18.0.0版、Dell G3電腦。

      react 怎么實(shí)現(xiàn)頁面跳轉(zhuǎn)不記錄?

      React-router:頁面跳轉(zhuǎn)并清除當(dāng)前頁的歷史記錄

      有如下情況:

      用戶打開激活鏈接;用戶完成激活過程后,系統(tǒng)會將其移至另一個頁面。

      我不想將激活鏈接保留在瀏覽器的歷史記錄中,因?yàn)楫?dāng)用戶返回時,他們將再次進(jìn)入激活步驟。

      可以通過replace進(jìn)行頁面跳轉(zhuǎn)

      this.props.history.replace("/home");
      登錄后復(fù)制

      相關(guān)介紹:

      this.props.history.replace()該方法中的參數(shù)為replace屬性為true的Link組件的to屬性,也可以傳遞state;

       this.props.history.replace(`/Page2/Div1`)  //等同于  <Link replace to=`/Page2/Div1`></Link>  this.props.history.replace(`/Page2/Div1`,{ id: 1, message: "你好啊" })  //等同于  <Link replace to={{pathname:`/Page2/Div1`,state:{id: 1, message: "你好啊"}}></Link>
      登錄后復(fù)制

      推薦學(xué)習(xí):《react視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號