From daa2b48efb4672005b8e929ec6e1a568aaf1a6c6 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 11 Oct 2023 09:30:29 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20SimpleMenuTag=E7=9A=84=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E9=83=BD=E6=94=B9=E4=B8=BA=E5=8A=A8=E6=80=81=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BC=95=E7=94=A8,=E4=BB=A5=E6=B6=88=E9=99=A4?= =?UTF-8?q?=E6=89=93=E5=8C=85=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SimpleMenu/index.ts | 1 - src/layouts/default/sider/MixSider.vue | 30 ++++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/components/SimpleMenu/index.ts b/src/components/SimpleMenu/index.ts index 7c0301bd..c2957f99 100644 --- a/src/components/SimpleMenu/index.ts +++ b/src/components/SimpleMenu/index.ts @@ -1,2 +1 @@ export { default as SimpleMenu } from './src/SimpleMenu.vue' -export { default as SimpleMenuTag } from './src/SimpleMenuTag.vue' diff --git a/src/layouts/default/sider/MixSider.vue b/src/layouts/default/sider/MixSider.vue index d1ce065c..0e506c83 100644 --- a/src/layouts/default/sider/MixSider.vue +++ b/src/layouts/default/sider/MixSider.vue @@ -8,7 +8,7 @@ import LayoutTrigger from '../trigger/index.vue' import { useDragLine } from './useLayoutSider' import type { Menu } from '@/router/types' import { ScrollContainer } from '@/components/Container' -import { SimpleMenu, SimpleMenuTag } from '@/components/SimpleMenu' +import { SimpleMenu } from '@/components/SimpleMenu' import { Icon } from '@/components/Icon' import { AppLogo } from '@/components/Application' import { useMenuSetting } from '@/hooks/setting/useMenuSetting' @@ -20,6 +20,9 @@ import { useGo } from '@/hooks/web/usePage' import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '@/enums/appEnum' import { getChildrenMenus, getCurrentParentPath, getShallowMenus } from '@/router/menus' import { listenerRouteChange } from '@/logics/mitt/routeChange' +import { createAsyncComponent } from '@/utils/factory/createAsyncComponent' + +const SimpleMenuTag = createAsyncComponent(() => import('/@/components/SimpleMenu/src/SimpleMenuTag.vue')) const wrap = ref(null) const menuModules = ref([]) @@ -228,17 +231,14 @@ onClickOutside(wrap, () => {