//在react中跳转路由需要用到白名单
import { withRouter } from 'react-router-dom';
//通过withRouter加工后的组件会多出一个history props,这时就可以通过history的push方法进行路由跳转了
this.props.history.push('/home')
react白名单的使用
最新推荐文章于 2023-02-14 16:36:03 发布
//在react中跳转路由需要用到白名单
import { withRouter } from 'react-router-dom';
//通过withRouter加工后的组件会多出一个history props,这时就可以通过history的push方法进行路由跳转了
this.props.history.push('/home')