From 1ef49e542d23ca44696ec5dd2f6498a4ea8135aa Mon Sep 17 00:00:00 2001 From: vben Date: Sat, 12 Dec 2020 00:46:09 +0800 Subject: [PATCH] fix(menu): fix menu split mode problem --- CHANGELOG.zh_CN.md | 1 + src/components/Menu/src/BasicMenu.tsx | 7 +++---- src/layouts/default/header/LayoutMultipleHeader.tsx | 5 ++--- src/router/routes/modules/dashboard.ts | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 0fd29e6b..08115f3b 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -21,6 +21,7 @@ - 修改 `VirtualScroll`和`ImportExcel`组件名为`VScroll`与`ImpExcel`,暂时解决含有关键字的组件在 vue 模版内使用内存溢出 - 修复 axios 大小写问题 - 修复按钮样式问题 +- 修复菜单分割模式问题 ## 2.0.0-rc.13 (2020-12-10) diff --git a/src/components/Menu/src/BasicMenu.tsx b/src/components/Menu/src/BasicMenu.tsx index 22649bc1..32a83d25 100644 --- a/src/components/Menu/src/BasicMenu.tsx +++ b/src/components/Menu/src/BasicMenu.tsx @@ -100,11 +100,10 @@ export default defineComponent({ const getWrapperStyle = computed( (): CSSProperties => { - const isHorizontal = unref(getIsHorizontal); + const isHorizontal = unref(getIsHorizontal) || getSplit.value; + return { - height: isHorizontal - ? `calc(100% + 1px)` - : `calc(100% - ${props.showLogo ? '48px' : '0px'})`, + height: isHorizontal ? `calc(100%)` : `calc(100% - ${props.showLogo ? '48px' : '0px'})`, overflowY: isHorizontal ? 'hidden' : 'auto', }; } diff --git a/src/layouts/default/header/LayoutMultipleHeader.tsx b/src/layouts/default/header/LayoutMultipleHeader.tsx index bae171f5..6fa7336e 100644 --- a/src/layouts/default/header/LayoutMultipleHeader.tsx +++ b/src/layouts/default/header/LayoutMultipleHeader.tsx @@ -21,7 +21,7 @@ export default defineComponent({ const injectValue = useLayoutContext(); - const { getCalcContentWidth, getSplit } = useMenuSetting(); + const { getCalcContentWidth } = useMenuSetting(); const { getFixed, @@ -56,8 +56,7 @@ export default defineComponent({ (): CSSProperties => { const style: CSSProperties = {}; if (unref(getFixed)) { - style.width = - unref(injectValue.isMobile) || unref(getSplit) ? '100%' : unref(getCalcContentWidth); + style.width = unref(injectValue.isMobile) ? '100%' : unref(getCalcContentWidth); } if (unref(getShowFullHeaderRef)) { style.top = `${unref(fullHeaderHeightRef)}px`; diff --git a/src/router/routes/modules/dashboard.ts b/src/router/routes/modules/dashboard.ts index ca88a7cc..31b21f23 100644 --- a/src/router/routes/modules/dashboard.ts +++ b/src/router/routes/modules/dashboard.ts @@ -7,7 +7,7 @@ const dashboard: AppRouteModule = { path: '/dashboard', name: 'Dashboard', component: LAYOUT, - redirect: '/dashboard/welcome', + redirect: '/dashboard/workbench', meta: { icon: 'bx:bx-home', title: t('routes.dashboard.dashboard'), -- GitLab