页面跳转
方法一:
使用this.props.history.push的具体方法:
pathname:写跳转界面的路径
state:要传过去的数据
例:this.props.history.push({ pathname: '/index', state: { name} });
页面取值:this.props.location.state.name
<button onClick={()=>his.props.history.push('/student/taskManage/index')} >点击跳转</button>
方法二
import Redircet from 'react-router-dom';
render: (text,record){
if(this.state.redirect){
return <Redirect push to='/index'>
}
}
posted on 2019-07-01 16:29 Cherish_Now 阅读(190) 评论(0) 收藏 举报
浙公网安备 33010602011771号