借助this.props.history对象上的API对操作路由跳转、前进、后退
路由跳转并留下历史记录:this.props.history.push()
路由跳转但不留下历史记录:this.props.history.replace()
路由后退一条记录:this.props.history.goBack()
路由前进一条记录:this.props.history.goForward()
路由前进或后退任意位置:this.props.history.go()
react 编程式路由导航
最新推荐文章于 2025-06-16 20:23:48 发布