有三种方法
(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;