关键词搜索

全站搜索
×
密码登录在这里
×
注册会员

已有账号? 请点击

忘记密码

已有账号? 请点击

使用其他方式登录

Vue报错:NavigationDuplicated: Avoided redundant navigation to current location:

发布2022-02-26 浏览1094次

详情内容

在用vue开发项目时,在路由点击时:NavigationDuplicated: Avoided redundant navigation to current location: “/”的问题。

先来看报错截图:

image.png

导致这样问题是连续点击相同路由导致报错(不影响正常操作行为)

解决方法

在router的index.js中增加如下代码:

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

image.png

点击QQ咨询
开通会员
上传资源赚钱
返回顶部
×
  • 微信支付
  • 支付宝付款
扫码支付
微信扫码支付
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载