有三種方法
(1)沒有傳參的話,可以有三種方法進行頁面之間的跳轉
a. <link to = '/experiment/information' >
b. this.props.history.push('/experiment/information')
(2)需要傳參的話,可以使用dva的routerRedux來跳轉路由
步驟:1. 先引入 import { withRouter, routerRedux } from 'dva/router'
2. export default withRouter(connect(({dashboard}) => ({dashboard}))(TimeAxis))
3. this.props.dispatch(routerRedux.push({
pathname: '/experiment/information',
query: {id: id}
}))
4. 而后,在跳轉過去的model中可以獲取所傳遞的參數
const params = location.query;