feat(projects): theme store完成

This commit is contained in:
Soybean
2022-01-08 20:49:21 +08:00
parent 10e4d81bd6
commit bf020a8258
56 changed files with 1205 additions and 164 deletions

View File

@ -1,5 +1,5 @@
import type { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/layouts';
import { BasicLayout, BlankLayout } from '@/layouts';
import { consoleError } from '../common';
import { getViewComponent } from './component';
@ -30,14 +30,11 @@ function transformAuthRouteToVueRoute(item: AuthRoute.Route) {
if (hasComponent(item)) {
const action: ComponentAction = {
layout() {
itemRoute.component = Layout;
basic() {
itemRoute.component = BasicLayout;
},
blank() {
itemRoute.component = Layout;
if (itemRoute.meta) {
itemRoute.meta.blankLayout = true;
}
itemRoute.component = BlankLayout;
},
multi() {
// 多级路由一定有子路由
@ -77,13 +74,11 @@ function transformAuthRouteToVueRoute(item: AuthRoute.Route) {
} else {
const parentPath = `${itemRoute.path}-parent` as AuthRoute.SingleRouteParentPath;
if (item.meta.singleLayout === 'blank') {
itemRoute.meta!.blankLayout = true;
}
const layout = item.meta.singleLayout === 'basic' ? BasicLayout : BlankLayout;
const parentRoute: RouteRecordRaw = {
path: parentPath,
component: Layout,
component: layout,
redirect: item.path,
children: [itemRoute]
};