React-router v4.0 参数传递
1、使用query ,state ,这两种用法基本一样,这种的话页面已刷新就没有了,
点击跳转到别的组件,query传递参数
this.props.history.push({pathname:'/about',query:{id:6,name:"tom"}})
在about组件中接收
var data = this.props.location.query;
var {id,name}...
原创
2018-11-27 20:16:10 ·
465 阅读 ·
0 评论