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,
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did222630