ant desgin pro 跨頁面傳參

1 link方式javascript

import { Link } from 'react-router-dom';
或者
import { Link } from 'dva/router';

<Link to={{pathname:'/user',query:id}}>添加用戶</Link>

  使用v2,v3this.props.location.query或者v4的this.props.location.search接收值java

2 routerRedux方式react

import { routerRedux } from 'dva/router';

goOrder (record){//頁面跳轉+參數
    this.props.dispatch(routerRedux.push({ 
      pathname: '/giveData/queryOrder',
      params: record.userId
    }))
  }

<a className={styles.oprLink} onClick={()=>this.goOrder(record)}>查訂單</a>

使用this.props.location.params接收值react-router

相關文章
相關標籤/搜索