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,5 +1,5 @@
import type { CustomRoute } from '@/interface';
import { BasicLayout, RouterViewLayout } from '@/layouts';
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout } from '@/layouts';
import ComponentMap from '@/views/component/map/index.vue';
import ComponentVideo from '@/views/component/video/index.vue';
import EditorQuill from '@/views/component/editor/quill/index.vue';
@ -7,7 +7,7 @@ import EditorMarkdown from '@/views/component/editor/markdown/index.vue';
import ComponentSwiper from '@/views/component/swiper/index.vue';
import { routeName, routePath, routeTitle } from '../constant';
const COMPONENT: CustomRoute = {
const COMPONENT: RouteRecordRaw = {
name: routeName('component'),
path: routePath('component'),
component: BasicLayout,
@ -42,12 +42,9 @@ const COMPONENT: CustomRoute = {
{
name: routeName('component_editor'),
path: routePath('component_editor'),
component: RouterViewLayout,
redirect: { name: routeName('component_editor_quill') },
meta: {
requiresAuth: true,
title: routeTitle('component_editor'),
fullPage: true
title: routeTitle('component_editor')
},
children: [
{