react web项目,页面刷新url的参数不消失
1、安装 query-string
npm i -save-dev query-string
2、点击按钮跳转页面:
this.props.history.push({
pathname: '/g6',
search:`?id=${id}&name=${name}`
});
3、g6页面获取参数:
let {id,name} = querystring.parse(this.props.location.search)
react web项目,页面刷新url的参数不消失
1、安装 query-string
npm i -save-dev query-string
2、点击按钮跳转页面:
this.props.history.push({
pathname: '/g6',
search:`?id=${id}&name=${name}`
});
3、g6页面获取参数:
let {id,name} = querystring.parse(this.props.location.search)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。