解决elementUI中使用el-submenu的路由模式会报错的问题

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

// 下面的代码是vue的路由中的默认代码,把上面的代码复制粘贴到new VueRouter之前就ok

const router = new VueRouter({
  routes
})

 

posted @ 2020-06-15 23:30  深海里的星星i  阅读(1900)  评论(0)    收藏  举报