vue报错 :NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}

vue报错 :NavigationDuplicated {_name: “NavigationDuplicated”, name: “NavigationDuplicated”}

main.js中添加:

// 处理element  NavigationDuplicated  错误
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}

或者:

import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
发布了106 篇原创文章 · 获赞 21 · 访问量 7万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 点我我会动 设计师: 上身试试

分享到微信朋友圈

×

扫一扫,手机浏览