vue的push和replace跳转


1. push会添加一条history记录

2. replace会替换掉当前的history记录

      _this.$router.push({
        path: "/new-message",
        query: {
          appid: _this.authorizer_appid
        }
      });


      this.$router.replace({
        path: '/authorize-thirdparty',
        query: {
          curTab: 2
        }
      })

3. push在加上replace: true后,它不会向 history 添加新记录,而是跟它的方法名一样 —— 替换掉当前的 history 记录。

//push方法也可以传replace
this.$router.push({path: '/home', replace: true})

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM