fix: 新增侧边栏和首页

This commit is contained in:
MTrun
2021-12-18 22:05:00 +08:00
parent 90e45f6c23
commit c1daa231b6
29 changed files with 451 additions and 86 deletions
-1
View File
@@ -40,7 +40,6 @@ export const HttpErrorPage: RouteRecordRaw[] = [
},
]
// 404 on a page
export const ErrorPageRoute: AppRouteRecordRaw = {
path: '/:path(.*)*',
name: 'ErrorPage',
+38 -2
View File
@@ -1,14 +1,50 @@
import { RouteRecordRaw } from 'vue-router'
import { PageEnum } from '@/enums/pageEnum'
// 引入路径
const importPath = {
'PageEnum.BASE_HOME_NAME': () => import('@/views/project/index.vue'),
'PageEnum.BASE_HOME_ITEMS_NAME': () => import('@/views/project/items/index.vue'),
'PageEnum.BASE_HOME_TEMPLATE_NAME': () => import('@/views/project/mtTemplate/index.vue'),
'PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME': () => import('@/views/project/templateMarket/index.vue')
}
const projectRoutes: RouteRecordRaw = {
path: PageEnum.BASE_HOME,
name: PageEnum.BASE_HOME_NAME,
component: () => import('@/views/project/index.vue'),
component: importPath['PageEnum.BASE_HOME_NAME'],
redirect: PageEnum.BASE_HOME_ITEMS,
meta: {
title: '项目',
isRoot: true
}
},
// todo 可采用循环动态插入
children: [
{
path: PageEnum.BASE_HOME_ITEMS,
name: PageEnum.BASE_HOME_ITEMS_NAME,
component: importPath['PageEnum.BASE_HOME_ITEMS_NAME'],
meta: {
title: PageEnum.BASE_HOME_ITEMS_NAME
}
},
{
path: PageEnum.BASE_HOME_TEMPLATE,
name: PageEnum.BASE_HOME_TEMPLATE_NAME,
component: importPath['PageEnum.BASE_HOME_TEMPLATE_NAME'],
meta: {
title: PageEnum.BASE_HOME_TEMPLATE_NAME
}
},
{
path: PageEnum.BASE_HOME_TEMPLATE_MARKET,
name: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
component: importPath['PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME'],
meta: {
title: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME
}
}
]
}
export default projectRoutes