import Vue from "vue"; import VueRouter from "vue-router"; import modelLibrary from "./modelLibrary"; import algorithmsLibrary from "./algorithmsLibrary"; import sceneLibrary from "./sceneLibrary"; import systemManagement from "./systemManagement"; import workManagement from "./workManagement"; Vue.use(VueRouter); const routes = [{ path: "/", name: "index", meta: { tabname: "首页" }, component: () => import('../views/index'), redirect: '/mainPage', children: [ { path: "/mainPage", name: "mainPage", // meta: { // tabname: "首页" // }, component: () => import("../views/mainPage.vue") }, { path: "/modelLibrary", name: "modelLibrary", meta: { tabname: "模型库" }, component: () => import("@/views/modelLibrary/index"), redirect: '/index', children: modelLibrary, }, { path: "/algorithmsLibrary", name: "algorithmsLibrary", meta: { tabname: "算法库" }, component: () => import("@/views/algorithmsLibrary/index"), redirect: '/index', children: algorithmsLibrary, }, { path: "/sceneLibrary", name: "sceneLibrary", meta: { tabname: "场景库" }, component: () => import("@/views/sceneLibrary/index"), redirect: '/index', children: sceneLibrary, }, { path: "/workManagement", name: "workManagement", meta: { tabname: "工作管理" }, component: () => import("@/views/workManagement/index"), redirect: '/index', children: workManagement, }, /* { path: "/systemManagement", name: "systemManagement", meta: { tabname: "系统管理" }, component: () => import("@/views/systemManagement/index"), redirect: '/index', children: systemManagement, }, */ ] .concat([{ path: "*", name: "*", component: () => import("../views/mainPage.vue") }, ]), }]; // { // path: "/", // name: "About", // // route level code-splitting // // this generates a separate chunk (about.[hash].js) for this route // // which is lazy-loaded when the route is visited. // component: () => // import( /* webpackChunkName: "about" */ "../views/About.vue"), // }, const router = new VueRouter({ mode: "history", base: process.env.BASE_URL, routes, scrollBehavior(to, from, savedPosition) { return {x: 0, y: 0} } }); export default router;