react-router 跳转传参

跳转传参

  1. Link跳转

    


============================================


    


参数获取 this.props.params.query

    


============================================


    


参数获取 this.props.location.query
  1. history跳转
browserHistory绝对路径
hasHistory相对路径


    


============================================

gotoHomeView() {
    this.props.homePressDown();
    hashHistory.push({
        pathname:'/UserOrderLogistics',
        query:{ship_no:ship_no,ship_id:ship_id}
    });
}

参数获取 this.props.location.query
  1. IndexLink

    


============================================
如果链接到根路由/,不要使用Link组件,而要使用IndexLink组件

    
      Home
    

或者使用hasHistory

你可能感兴趣的:(react-router 跳转传参)