router.replace(),后router.go(-1)需要点击两次才能返回解决

现在有三个页面A页面,B页面,C页面
需要实现的功能是:
A跳转>B,B跳转>C,C页面使用replace()跳转>B,B返回A

解决方案

在C跳转B的时候使用router.replace()跳转,同时router.go(-1)

this.$router.replace({name:'b'})
this.$router.go(-1)

猜你喜欢

转载自blog.csdn.net/qq_40745143/article/details/105748501