From e2b320ad2796e5e0c45f4dc5258f46ee79fc3b7d Mon Sep 17 00:00:00 2001 From: Soybean Date: Wed, 8 Mar 2023 06:40:40 +0800 Subject: [PATCH] refactor(projects): rename union key --- src/typings/union-key.d.ts | 14 +++++++------- src/utils/router/component.ts | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/typings/union-key.d.ts b/src/typings/union-key.d.ts index 1202824b5..ca82c415f 100644 --- a/src/typings/union-key.d.ts +++ b/src/typings/union-key.d.ts @@ -2,6 +2,13 @@ declare namespace UnionKey { /** http请求头的content-type类型 */ type ContentType = 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data'; + /** + * 布局组件的名称 + * - basic 基础布局 + * - blank 空白布局 + */ + type LayoutComponentType = 'basic' | 'blank'; + /** * 登录模块 * - pwd-login: 账密登录 @@ -46,11 +53,4 @@ declare namespace UnionKey { * - fade-scale: 缩放消退 */ type ThemeAnimateMode = 'zoom-fade' | 'zoom-out' | 'fade-slide' | 'fade' | 'fade-bottom' | 'fade-scale'; - - /** - * 布局组件的名称 - * - basic 基础布局 - * - blank 空白布局 - */ - type LayoutComponentName = 'basic' | 'blank'; } diff --git a/src/utils/router/component.ts b/src/utils/router/component.ts index 381f8c5eb..c8c83ec19 100644 --- a/src/utils/router/component.ts +++ b/src/utils/router/component.ts @@ -9,13 +9,13 @@ interface ModuleComponent { default: RouteComponent; } -type LayoutComponent = Record>; +type LayoutComponent = Record>; /** * 获取布局的vue文件(懒加载的方式) * @param layoutType - 布局类型 */ -export function getLayoutComponent(layoutType: UnionKey.LayoutComponentName) { +export function getLayoutComponent(layoutType: UnionKey.LayoutComponentType) { const layoutComponent: LayoutComponent = { basic: BasicLayout, blank: BlankLayout