1.Link state传参

  

import {Link} from 'react-router-dom';

  

<Link className={"btn_tableOp"} to={{
                        pathname: '/web/credit/customer/customer/informationManager/infoManagerView',
                        state: {value: 'params-test'}}}>
  查看
</Link>

  

componentWillMount() {
   console.log(this.props.location.state.value, 'value')
}

方法弊端:页面刷新后无法获取参数报错;

 

2.session存储

3.存入路径

<Link className={"btn_tableOp"} to={`/web/credit/customer/customer/informationManager/view/${record.customerCode}/${record.tradeCode}`}>查看</Link>

路由配置

 <Route path="/web/credit/customer/customer/informationManager/view/:customerCode/:tradeCode" exact component={InfoManagerView} />

获取方式

this.props.match.params.customerCode,

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-02-04
  • 2021-12-17
  • 2021-07-27
  • 2021-10-05
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-10-02
  • 2022-12-23
相关资源
相似解决方案