feat(projects): add 'vertical-hybrid-header-first' layout mode

This commit is contained in:
wenyuan
2025-07-12 23:35:45 +08:00
committed by Soybean
parent b6ac3106ce
commit b4e5c6d990
15 changed files with 310 additions and 94 deletions

View File

@ -3,6 +3,7 @@ import { computed } from 'vue';
import { createReusableTemplate } from '@vueuse/core';
import { SimpleScrollbar } from '@sa/materials';
import { transformColorWithOpacity } from '@sa/color';
import type { RouteKey } from '@elegant-router/types';
defineOptions({
name: 'FirstLevelMenu'
@ -20,7 +21,7 @@ interface Props {
const props = defineProps<Props>();
interface Emits {
(e: 'select', menu: App.Global.Menu): boolean;
(e: 'select', menuKey: RouteKey): boolean;
(e: 'toggleSiderCollapse'): void;
}
@ -47,8 +48,8 @@ const selectedBgColor = computed(() => {
return darkMode ? dark : light;
});
function handleClickMixMenu(menu: App.Global.Menu) {
emit('select', menu);
function handleClickMixMenu(menuKey: RouteKey) {
emit('select', menuKey);
}
function toggleSiderCollapse() {
@ -88,7 +89,7 @@ function toggleSiderCollapse() {
:icon="menu.icon"
:active="menu.key === activeMenuKey"
:is-mini="siderCollapse"
@click="handleClickMixMenu(menu)"
@click="handleClickMixMenu(menu.routeKey)"
/>
</SimpleScrollbar>
<MenuToggler