vue中的this.$router.replace()和.push()和.go()的区别解析

2022年7月6日09:17:59

1. this.$router.push()

跳转到不同的url,但这个方法会向history栈添加一个记录,点击后会返回到上一个页面。

2. this.$router.replace()

跳转到不同的url,这个方法不会向history栈添加一个记录,点击后会返回到上上一个页面

3. this.$router.go(n)

向前向后跳转n个页面,n为正数向前跳转n个页面,负数后退n个页面

  • 作者:灬繁花落雨灬
  • 原文链接:https://blog.csdn.net/qq_42426993/article/details/122330622
    更新时间:2022年7月6日09:17:59 ,共 187 字。