首页 / 科技百科 / 正文

react获取URL中参数

react 获取URL原理:

在 react 组件的 componentDidMount 方法中打印一下 this.props,在浏览器控制台中查看输出如下:

其中页面的 url 信息全都包含在 match 字段中,

首先打印 this.props.match :

如有侵权请及时联系我们处理,转载请注明出处来自