0
点赞
收藏
分享

微信扫一扫

RabbitMQ系列(25)--RabbitMQ搭建镜像队列

思考的鸿毛 2023-07-13 阅读 43

1、params参数:

路由链接(携带参数):详情

注册路由(声明接收):

接收参数: this.props.match.params

2、search参数:

路由链接(携带参数):<Link to=“/demo/test?name=tom&age=18”>详情

注册路由(无需声明,正常注册即可):

接收参数: this.props.location.search

备注:获取到的search是urlencoded编码字符串,需要借助querystring解析。

3、state参数:

路由链接(携带参数):<Link to={{pathname:‘/demo/test’,state: {name: ‘tom’,age:18}}}>详情

注册路由(无需声明,正常注册即可):

接收参数: this.props.location.state

备注:如果不用BrowserRouter,刷新保留不住参数,因为BrowserRouter的history里保留了参数信息。

举报

相关推荐

0 条评论