diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu.vue b/packages/@core/ui-kit/menu-ui/src/components/menu.vue
index 92ee1198..57670997 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/menu.vue
@@ -507,12 +507,12 @@ $namespace: vben;
}
&.is-light {
- --menu-item-active-color: hsl(var(--primary));
- --menu-item-active-background-color: hsl(var(--primary) / 15%);
+ --menu-item-active-color: hsl(var(--primary-foreground));
+ --menu-item-active-background-color: hsl(var(--primary));
--menu-item-hover-background-color: hsl(var(--accent));
--menu-item-hover-color: hsl(var(--primary));
- --menu-submenu-active-color: hsl(var(--primary));
- --menu-submenu-active-background-color: hsl(var(--primary) / 15%);
+ --menu-submenu-active-color: hsl(var(--primary-foreground));
+ --menu-submenu-active-background-color: hsl(var(--primary));
--menu-submenu-hover-color: hsl(var(--primary));
--menu-submenu-hover-background-color: hsl(var(--accent));
}
diff --git a/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue b/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
index 40233ea8..8efb018d 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
@@ -69,16 +69,17 @@ $namespace: vben;
&.is-dark {
.#{$namespace}-normal-menu__item {
- color: hsl(var(--foreground) / 80%);
+ @apply text-foreground/80;
+ // color: hsl(var(--foreground) / 80%);
&:not(.is-active):hover {
- color: hsl(var(--primary-foreground));
+ @apply text-foreground;
}
&.is-active {
.#{$namespace}-normal-menu__name,
.#{$namespace}-normal-menu__icon {
- color: hsl(var(--primary-foreground));
+ @apply text-foreground;
}
}
}
@@ -117,11 +118,11 @@ $namespace: vben;
border-color 0.15s ease;
&.is-active {
- @apply text-primary bg-primary/15 dark:bg-accent;
+ @apply text-primary bg-primary dark:bg-accent;
.#{$namespace}-normal-menu__name,
.#{$namespace}-normal-menu__icon {
- @apply text-primary font-semibold;
+ @apply text-primary-foreground font-semibold;
}
}
diff --git a/packages/@core/ui-kit/menu-ui/src/sub-menu.vue b/packages/@core/ui-kit/menu-ui/src/sub-menu.vue
index 99719ba1..f65320d1 100644
--- a/packages/@core/ui-kit/menu-ui/src/sub-menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/sub-menu.vue
@@ -56,6 +56,7 @@ const hasChildren = computed(() => {
:badge="menu.badge"
:badge-type="menu.badgeType"
:badge-variants="menu.badgeVariants"
+ class="right-6"
/>
{{ menu.name }}
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/menu-badge.vue b/packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/menu-badge.vue
index 3ee22041..db07c197 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/menu-badge.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/menu-badge.vue
@@ -43,13 +43,13 @@ const badgeStyle = computed(() => {
});
-
+
{{ badge }}
diff --git a/packages/effects/layouts/src/basic/menu/use-extra-menu.ts b/packages/effects/layouts/src/basic/menu/use-extra-menu.ts
index 9beed94c..8413a31f 100644
--- a/packages/effects/layouts/src/basic/menu/use-extra-menu.ts
+++ b/packages/effects/layouts/src/basic/menu/use-extra-menu.ts
@@ -80,14 +80,19 @@ function useExtraMenu() {
watch(
() => route.path,
- () => {
+ (path) => {
+ const currentPath = path;
+ // if (preferences.sidebar.expandOnHover) {
+ // return;
+ // }
const { findMenu, rootMenu, rootMenuPath } = findRootMenuByPath(
menus.value,
- route.path,
+ currentPath,
);
extraActiveMenu.value = rootMenuPath ?? findMenu?.path ?? '';
extraMenus.value = rootMenu?.children ?? [];
},
+ { immediate: true },
);
return {
diff --git a/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts b/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts
index 439aa74c..f2507fc7 100644
--- a/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts
+++ b/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts
@@ -57,7 +57,7 @@ function useMixedMenu() {
* 侧边菜单激活路径
*/
const sidebarActive = computed(() => {
- return route.path;
+ return route?.meta?.activePath ?? route.path;
});
/**
@@ -104,9 +104,11 @@ function useMixedMenu() {
watch(
() => route.path,
- (path: string) => {
- calcSideMenus(path);
+ (path) => {
+ const currentPath = (route?.meta?.activePath as string) ?? path;
+ calcSideMenus(currentPath);
},
+ { immediate: true },
);
// 初始化计算侧边菜单
diff --git a/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue b/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue
index 472727d4..a5887b2e 100644
--- a/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue
+++ b/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue
@@ -27,7 +27,7 @@ const sidebarCollapsed = defineModel('sidebarCollapsed');
{{ $t('preferences.sidebar.collapsedShowTitle') }}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a64fbe4e..09006fc2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -741,9 +741,6 @@ importers:
'@vben-core/shadcn-ui':
specifier: workspace:*
version: link:../shadcn-ui
- '@vben-core/toolkit':
- specifier: workspace:*
- version: link:../../shared/toolkit
'@vben-core/typings':
specifier: workspace:*
version: link:../../shared/typings