页面跳转传参方式

2020-01-02  本文已影响0人  皮卡皮卡皮卡丘11

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
上一篇 下一篇

猜你喜欢

热点阅读