久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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跳轉(zhuǎn)路由頁面空白怎么辦

      react跳轉(zhuǎn)路由頁面空白是因?yàn)閷懛ㄥe誤,其解決辦法:1、確定頁面需要實(shí)現(xiàn)的鏈接;2、修改代碼為“this.props.history.push({pathname:`/cardetails`,search:`?productId=${car.productId}`,state:car,})”即可。

      react跳轉(zhuǎn)路由頁面空白怎么辦

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

      react跳轉(zhuǎn)路由頁面空白怎么辦?

      react 路由傳參跳轉(zhuǎn)時,頁面空白

      //頁面需要實(shí)現(xiàn)的鏈接是這樣的,http://localhost:4500/cardetails?productId=12676   //會導(dǎo)致空白的錯誤寫法是 this.props.history.push({                 pathname:`/cardetails?productId=${car.productId}`,                 state:car,             })     //正確寫法是下面 this.props.history.push({                 pathname:`/cardetails`,                 search:`?productId=${car.productId}`,                 state:car,             })     //以上是個人開發(fā)中遇到的問題,僅供參考~~
      登錄后復(fù)制

      錯誤寫法,是點(diǎn)擊事件后,頁面鏈接已經(jīng)發(fā)生變化,但是頁面內(nèi)容是空白,沒有報(bào)錯,需手動刷新頁面,才可以看的內(nèi)容,

      寫法改變后,可以準(zhǔn)確的定位到路由信息,解決問題。

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

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