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
网友评论