From 2f53d157970f6015bc2b78e0e2499a513c173f13 Mon Sep 17 00:00:00 2001 From: paynezhuang Date: Thu, 13 Jun 2024 21:47:34 +0800 Subject: [PATCH] fix(projects): menu layout show --- src/typings/api.d.ts | 2 +- src/typings/union-key.d.ts | 3 +++ src/views/manage/menu/modules/menu-operate-drawer.vue | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 3316dd5..923cf81 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -196,7 +196,7 @@ declare namespace Api { type Menu = Common.CommonRecord< { /** parent menu id */ - parentId: string; + parentId: UnionKey.StrNum; /** menu type */ type: MenuType; /** menu name */ diff --git a/src/typings/union-key.d.ts b/src/typings/union-key.d.ts index ff5020b..d4a8656 100644 --- a/src/typings/union-key.d.ts +++ b/src/typings/union-key.d.ts @@ -14,6 +14,9 @@ declare namespace UnionKey { /** Theme scheme */ type ThemeScheme = 'light' | 'dark' | 'auto'; + /** string or number */ + type StrNum = string | number; + /** * The layout mode * diff --git a/src/views/manage/menu/modules/menu-operate-drawer.vue b/src/views/manage/menu/modules/menu-operate-drawer.vue index 6095033..bf60c52 100644 --- a/src/views/manage/menu/modules/menu-operate-drawer.vue +++ b/src/views/manage/menu/modules/menu-operate-drawer.vue @@ -83,7 +83,7 @@ function createDefaultModel(): Model { sort: 0, href: '', keepAlive: 'Y', - parentId: '0', + parentId: 0, multiTab: 'N', activeMenu: '' as LastLevelRouteKey, fixedIndexInTab: -1, @@ -113,7 +113,7 @@ const localIconOptions = localIcons.map(item => ({ value: item })); -const showLayout = computed(() => model.parentId === '0'); +const showLayout = computed(() => model.parentId === 0); const showPage = computed(() => model.type === '2');