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 取到路由中传过来的参数
posted @ 2018-06-04 10:50  菜鸟乐谷  阅读(793)  评论(0编辑  收藏  举报