久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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返回頁面的幾種方式

      React返回頁面有3種方式,分別是:1、通過“this.props.history.push('/home');”方式返回到上一級頁面;2、通過“this.props.history.replace('/home');”方式返回頁面;3、通過“window.history.back(-1);”返回頁面。

      React返回頁面的幾種方式

      前端(vue)入門到精通課程:進入學(xué)習(xí)
      Apipost = Postman + Swagger + Mock + Jmeter 超好用的API調(diào)試工具:點擊使用

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

      React返回頁面的幾種方式?

      react 移動端返回上一級頁面的寫法

      移動端返回上一級頁面的寫法:

      import React, {Component} from 'react'; import './style.less';   class Header extends Component {       clickBackHandler (){         // 返回到上一級頁面的幾種方法         //第一種 this.props.history.push('/home');         //第一種 this.props.history.replace('/home'); 但這兩種方法都不好         //第三種方法,推薦使用         window.history.back(-1);     }       render() {         return (             <div id="common-header">                 {/*Header 公共頭組件*/}                 <span className="back-icon">                     <i className="icon-chevron-left" onClick={ this.clickBackHandler }></i>                 </span>                 <h1>{ this.props.title }</h1>             </div>         );     } }   export default Header;
      登錄后復(fù)制

      React返回頁面的幾種方式

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

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