index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import Vue from "vue";
  2. import VueRouter from "vue-router";
  3. import modelLibrary from "./modelLibrary";
  4. import algorithmsLibrary from "./algorithmsLibrary";
  5. import sceneLibrary from "./sceneLibrary";
  6. import systemManagement from "./systemManagement";
  7. import workManagement from "./workManagement";
  8. Vue.use(VueRouter);
  9. const routes = [{
  10. path: "/",
  11. name: "index",
  12. meta: {
  13. tabname: "首页"
  14. },
  15. component: () => import('../views/index'),
  16. redirect: '/mainPage',
  17. children: [
  18. {
  19. path: "/mainPage",
  20. name: "mainPage",
  21. // meta: {
  22. // tabname: "首页"
  23. // },
  24. component: () => import("../views/mainPage.vue")
  25. },
  26. {
  27. path: "/modelLibrary",
  28. name: "modelLibrary",
  29. meta: {
  30. tabname: "模型库"
  31. },
  32. component: () => import("@/views/modelLibrary/index"),
  33. redirect: '/index',
  34. children: modelLibrary,
  35. },
  36. {
  37. path: "/algorithmsLibrary",
  38. name: "algorithmsLibrary",
  39. meta: {
  40. tabname: "算法库"
  41. },
  42. component: () => import("@/views/algorithmsLibrary/index"),
  43. redirect: '/index',
  44. children: algorithmsLibrary,
  45. },
  46. {
  47. path: "/sceneLibrary",
  48. name: "sceneLibrary",
  49. meta: {
  50. tabname: "场景库"
  51. },
  52. component: () => import("@/views/sceneLibrary/index"),
  53. redirect: '/index',
  54. children: sceneLibrary,
  55. },
  56. {
  57. path: "/workManagement",
  58. name: "workManagement",
  59. meta: {
  60. tabname: "工作管理"
  61. },
  62. component: () => import("@/views/workManagement/index"),
  63. redirect: '/index',
  64. children: workManagement,
  65. },
  66. /* {
  67. path: "/systemManagement",
  68. name: "systemManagement",
  69. meta: {
  70. tabname: "系统管理"
  71. },
  72. component: () => import("@/views/systemManagement/index"),
  73. redirect: '/index',
  74. children: systemManagement,
  75. }, */
  76. ]
  77. .concat([{
  78. path: "*",
  79. name: "*",
  80. component: () => import("../views/mainPage.vue")
  81. }, ]),
  82. }];
  83. // {
  84. // path: "/",
  85. // name: "About",
  86. // // route level code-splitting
  87. // // this generates a separate chunk (about.[hash].js) for this route
  88. // // which is lazy-loaded when the route is visited.
  89. // component: () =>
  90. // import( /* webpackChunkName: "about" */ "../views/About.vue"),
  91. // },
  92. const router = new VueRouter({
  93. mode: "history",
  94. base: process.env.BASE_URL,
  95. routes,
  96. scrollBehavior(to, from, savedPosition) {
  97. return {x: 0, y: 0}
  98. }
  99. });
  100. export default router;