123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- 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"; // 工作管理
- import personalInformation from "./personalInformation"
- Vue.use(VueRouter);
- const routes = [{
- path: "/login",
- name: "login",
- component: () => import("../views/login.vue")
- },
- {
- 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,
- },
- {
- path: "/personalInformation",
- name: "personalInformation",
- meta: {
- tabname: "个人信息"
- },
- component: () => import("@/views/personalInformation/personalInformation"),
- // redirect: '/index',
- // children: personalInformation,
- },
- ]
- // .concat([{
- // path: "*",
- // name: "*",
- // component: () => import("../views/mainPage.vue")
- // }, ]),
- },
- {
- path: "*",
- name: "*",
- component: () => import("@/views/mainPage.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;
|