index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import Vue from "vue";
  2. import Router from "vue-router";
  3. // 解决重复点菜单报错问题
  4. const originalPush = Router.prototype.push;
  5. Router.prototype.push = function push(location) {
  6. return originalPush.call(this, location).catch(err => err);
  7. };
  8. Vue.use(Router);
  9. export default new Router({
  10. routes: [
  11. { path: "/", redirect: "/redirectMaintain" },
  12. {
  13. path: "/index",
  14. component: () => import("../pages/index/layouts/indexLayout.vue"),
  15. children: [
  16. {
  17. name: "redirectMaintain",
  18. path: "/redirectMaintain",
  19. component: () => import("../pages/index/components/searchPage.vue")
  20. },
  21. {
  22. name: "entityDetail",
  23. path: "/entityDetail",
  24. component: () => import("../pages/index/components/entityDetail.vue")
  25. },
  26. {
  27. name: "audit",
  28. path: "/audit",
  29. component: () => import("../pages/index/audit.vue")
  30. },
  31. {
  32. name: "file",
  33. path: "/file",
  34. component: () => import("../pages/index/file.vue")
  35. }
  36. ]
  37. }
  38. ]
  39. });