vue-element导航菜单重复点击报错

使用element的导航菜单,渲染数据后,重复点击菜单会报错

 

 

在\src\router\index.js文件中加入

//获取原型对象上的push函数
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

可以解决此问题

posted @ 2021-03-12 21:27  艾尔熙得  阅读(144)  评论(0)    收藏  举报