feat(layout): added setting. Used to fix the left mixed mode menu

This commit is contained in:
vben
2021-01-03 10:42:19 +08:00
parent 5091a875ab
commit 97180e83f5
16 changed files with 192 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
import type { MenuSetting } from '/@/types/config';
import { computed, unref } from 'vue';
import { computed, unref, ref } from 'vue';
import { appStore } from '/@/store/modules/app';
@@ -8,6 +8,8 @@ import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '/@/enums/appE
import { MenuModeEnum, MenuTypeEnum, TriggerEnum } from '/@/enums/menuEnum';
import { useFullContent } from '/@/hooks/web/useFullContent';
const mixSideHasChildren = ref(false);
// Get menu configuration
const getMenuSetting = computed(() => appStore.getProjectConfig.menuSetting);
@@ -39,6 +41,8 @@ const getCanDrag = computed(() => unref(getMenuSetting).canDrag);
const getAccordion = computed(() => unref(getMenuSetting).accordion);
const getMixSideFixed = computed(() => unref(getMenuSetting).mixSideFixed);
const getTopMenuAlign = computed(() => unref(getMenuSetting).topMenuAlign);
const getCloseMixSidebarOnChange = computed(() => unref(getMenuSetting).closeMixSidebarOnChange);
@@ -87,7 +91,8 @@ const getCalcContentWidth = computed(() => {
unref(getIsTopMenu) || !unref(getShowMenu) || (unref(getSplit) && unref(getMenuHidden))
? 0
: unref(getIsMixSidebar)
? SIDE_BAR_SHOW_TIT_MINI_WIDTH
? SIDE_BAR_SHOW_TIT_MINI_WIDTH +
(unref(getMixSideFixed) && unref(mixSideHasChildren) ? unref(getRealWidth) : 0)
: unref(getRealWidth);
return `calc(100% - ${unref(width)}px)`;
@@ -148,5 +153,7 @@ export function useMenuSetting() {
getIsMixSidebar,
getCloseMixSidebarOnChange,
getMixSideTrigger,
getMixSideFixed,
mixSideHasChildren,
};
}