1. 程式人生 > >React-Router 獲取路由引數

React-Router 獲取路由引數

慢慢整理哈!

 componentWillMount() {
    let visitor = this.props.location.search;
    visitor = visitor.split('=')[1];
    this.setState({visitor:visitor});
  }

參考:

https://blog.csdn.net/qq20004604/article/details/79440416