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


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM