码迷,mamicode.com
首页 > Web开发 > 详细

react中进入某个详情页URL路劲参数Id获取问题

时间:2018-12-05 22:26:50      阅读:763      评论:0      收藏:0      [点我收藏+]

标签:mon   一行代码   mat   man   问题   url   const   detail   属性   

<Route path={`${match.url}/detail/:id`} component={AppManageAddDetail} />
const { match:{params:{ id, }}} = this.props;
一行代码直接搞定.
match和params都是this.props自带的属性,不需要单独配置,直接拿来用就行,
 
const { match:{params:{ id, }}} = this.props;
 

react中进入某个详情页URL路劲参数Id获取问题

标签:mon   一行代码   mat   man   问题   url   const   detail   属性   

原文地址:https://www.cnblogs.com/ChineseLiao/p/10073759.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!