zoukankan      html  css  js  c++  java
  • 关于VUE项目中报Error: Avoided redundant navigation to current location: 的错

    在VUE中路由遇到Error: Avoided redundant navigation to current location:报错显示是路由重复,

    粘贴图片

    虽然对项目无影响,但是看到有红的还是不舒服。

    于是查了一下发现可以这样解决

    router文件夹下面的index.js中加上下面几句代码

    const originalPush = Router.prototype.push
    Router.prototype.push = function push(location) {
      return originalPush.call(this, location).catch(err => err)
    }
     

    粘贴图片

  • 相关阅读:
    流程控制之while循环
    流程控制之if...else
    基本运算符
    基本数据类型
    注释
    用户交互
    常量
    test
    查询方法
    删除代码
  • 原文地址:https://www.cnblogs.com/chenwan1218/p/13130410.html
Copyright © 2011-2022 走看看