2022-04-03 学习记录--React-编程式路由导航

一、react-router-dom 旧版本

编程式路由导航
	借助this.prosp.history对象上的API对操作路由跳转、前进、后退
		-this.prosp.history.push()      // 跳转 不会留下浏览痕迹
		-this.prosp.history.replace()   // 跳转 会留下浏览痕迹
		-this.prosp.history.goBack()    // 点击一次,后退一步
		-this.prosp.history.goForward() // 点击一次,前进一步
		-this.prosp.history.go(n)       // n为正整数,就是前进,为好多 就前进好多步;n为负整数,就是后退,为好多 就后退好多步

猜你喜欢

转载自blog.csdn.net/weixin_48850734/article/details/123941501
今日推荐