美文网首页
页面跳转传参方式

页面跳转传参方式

作者: 皮卡皮卡皮卡丘11 | 来源:发表于2020-01-02 21:40 被阅读0次

1. match通过路径

<Route path="/path/:name" component={example} />

路由组件内获取参数使用

this.props.match.params.name

2. query String 通过search

//mirrorx中使用push的参数search,link中使用与此类似
actions.routing.push({
  pathname: '/path/example',
  search: `?name=${name}`,
 }
)

路由组件内获取参数使用

this.props.location.search

相关文章

网友评论

      本文标题:页面跳转传参方式

      本文链接:https://www.haomeiwen.com/subject/jacaoctx.html