Vue.use(VueRouter);
// 处理el-menu-item 路由重复跳转出错情况
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location: any) {
  return (originalPush.call(this, location) as any).catch((err: any) => {
    window.location.reload();
  });
};

const router = new VueRouter({
  base: "/",
  mode: "history",
  routes,
});

  

posted on 2020-07-17 11:10  ygunoil  阅读(329)  评论(0编辑  收藏  举报