diff --git a/packages/@vben-core/shared/typings/src/preference.ts b/packages/@vben-core/shared/typings/src/preference.ts index a58b9eb0..4e68c2f4 100644 --- a/packages/@vben-core/shared/typings/src/preference.ts +++ b/packages/@vben-core/shared/typings/src/preference.ts @@ -77,6 +77,8 @@ interface Preference { logo: string; /** logo是否可见 */ logoVisible: boolean; + /** 导航菜单手风琴模式 */ + navigationAccordion: boolean; /** 导航菜单是否切割,只在 layout=mixed-nav 生效 */ navigationSplit: boolean; /** 导航菜单风格 */ diff --git a/packages/business/common-ui/src/preference/blocks/layout/navigation.vue b/packages/business/common-ui/src/preference/blocks/layout/navigation.vue index 2c6b0185..8814ef1c 100644 --- a/packages/business/common-ui/src/preference/blocks/layout/navigation.vue +++ b/packages/business/common-ui/src/preference/blocks/layout/navigation.vue @@ -14,6 +14,7 @@ defineProps<{ disabled?: boolean; disabledNavigationSplit?: boolean }>(); const navigationStyle = defineModel('navigationStyle'); const navigationSplit = defineModel('navigationSplit'); +const navigationAccordion = defineModel('navigationAccordion'); const stylesItems: SelectListItem[] = [ { label: $t('preference.rounded'), value: 'rounded' }, @@ -29,10 +30,16 @@ const stylesItems: SelectListItem[] = [ > {{ $t('preference.navigation-style') }} - + {{ $t('preference.navigation-split') }} + + {{ $t('preference.navigation-accordion') }} + diff --git a/packages/business/common-ui/src/preference/preference-widget.vue b/packages/business/common-ui/src/preference/preference-widget.vue index ace6ebd6..d04b23b7 100644 --- a/packages/business/common-ui/src/preference/preference-widget.vue +++ b/packages/business/common-ui/src/preference/preference-widget.vue @@ -52,11 +52,15 @@ function updateLocale(value: string) { :page-progress="preference.pageProgress" :tabs-icon="preference.tabsIcon" :locale="preference.locale" + :navigation-accordion="preference.navigationAccordion" :navigation-style="preference.navigationStyle" :navigation-split="preference.navigationSplit" :side-collapse-show-title="preference.sideCollapseShowTitle" :page-transition-enable="preference.pageTransitionEnable" @update:navigation-style="(value) => handleUpdate('navigationStyle', value)" + @update:navigation-accordion=" + (value) => handleUpdate('navigationAccordion', value) + " @update:navigation-split="(value) => handleUpdate('navigationSplit', value)" @update:dynamic-title="(value) => handleUpdate('dynamicTitle', value)" @update:tabs-icon="(value) => handleUpdate('tabsIcon', value)" diff --git a/packages/business/common-ui/src/preference/preference.vue b/packages/business/common-ui/src/preference/preference.vue index 26f7fa7f..ab0a5ea0 100644 --- a/packages/business/common-ui/src/preference/preference.vue +++ b/packages/business/common-ui/src/preference/preference.vue @@ -54,6 +54,7 @@ const colorGrayMode = defineModel('colorGrayMode'); const colorPrimary = defineModel('colorPrimary'); const navigationStyle = defineModel('navigationStyle'); const navigationSplit = defineModel('navigationSplit'); +const navigationAccordion = defineModel('navigationAccordion'); const pageProgress = defineModel('pageProgress'); const pageTransition = defineModel('pageTransition'); const pageTransitionEnable = defineModel('pageTransitionEnable'); @@ -197,6 +198,7 @@ function handleReset() { diff --git a/packages/business/layouts/src/basic/content/content.vue b/packages/business/layouts/src/basic/content/content.vue index c080eda3..3d6a6ac5 100644 --- a/packages/business/layouts/src/basic/content/content.vue +++ b/packages/business/layouts/src/basic/content/content.vue @@ -50,6 +50,7 @@ function getTransitionName(route: RouteLocationNormalizedLoaded) { diff --git a/packages/business/layouts/src/basic/layout.vue b/packages/business/layouts/src/basic/layout.vue index c4df2c35..e4c7016f 100644 --- a/packages/business/layouts/src/basic/layout.vue +++ b/packages/business/layouts/src/basic/layout.vue @@ -183,6 +183,7 @@ function wrapperMenus(menus: MenuRecordRaw[]) {