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 取到路由中传过来的参数
转载于:https://www.cnblogs.com/cnlg123/p/9132214.html

  

posted on 2020-04-23 10:17  左侧岚  阅读(654)  评论(0编辑  收藏  举报

导航