React 使用link在url添加参数(url中不可见)

1. 在要跳转页面添加<Link to={{ pathname: `/staffManagement/cardRecord`, state: {time: YYYY-MM-dd, name: staffName} }}>text </Link>
 
2. 在跳转到的页面使用 this.props.location.state.time 取到路由中传过来的参数

猜你喜欢

转载自www.cnblogs.com/cnlg123/p/9132214.html
今日推荐