this.$router.push()
this.$router.replace()
<router-link to="/" />
<router-link to="/" replace />
//this.$router.push会在window.histroy中保留浏览器的历史记录,而this.$router.replace不会在history中保留。
this.$router.back()
this.$router.go(-1)
//成功返回上一页,也会清除掉上一条history记录
Vue H5 路由返回的集中实现
于 2023-04-08 10:17:29 首次发布