refactor(projects): 重构路由类型和路由元数据类型,重构多级菜单路由写法

This commit is contained in:
Soybean
2021-11-28 12:17:48 +08:00
parent 9fb641f71e
commit d683894beb
20 changed files with 144 additions and 115 deletions

View File

@@ -1,4 +1,4 @@
import type { CustomRoute } from '@/interface';
import type { RouteRecordRaw } from 'vue-router';
import { setSingleRoute } from '@/utils';
import { BasicLayout } from '@/layouts';
import About from '@/views/about/index.vue';
@@ -6,19 +6,21 @@ import { getRouteConst, routeName } from '../constant';
const { name, path, title } = getRouteConst('about');
const ABOUT: CustomRoute = setSingleRoute({
const ABOUT: RouteRecordRaw = setSingleRoute({
route: {
name,
path,
component: About,
meta: {
requiresAuth: true,
title,
requiresAuth: true,
keepAlive: true,
icon: 'fluent:book-information-24-regular'
}
},
container: BasicLayout,
meta: {
containerMeta: {
title,
order: 7
},
notFoundName: routeName('not-found')