问题:
输入下面代码放在
// router>index.js中添加代码:
,路由文件里面即可解决问题
import Vue from "vue"; import Router from "vue-router"; Vue.use(Router); // 解决element-ui点击同一个路由报错:NavigationDuplicated const originalPush = Router.prototype.push; Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err); };