mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
feat: add breadcrumb navigation example
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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 },
|
||||
);
|
||||
|
||||
// 初始化计算侧边菜单
|
||||
|
@@ -27,7 +27,7 @@ const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
|
||||
</SwitchItem>
|
||||
<SwitchItem
|
||||
v-model="sidebarCollapsedShowTitle"
|
||||
:disabled="!sidebarEnable || disabled"
|
||||
:disabled="!sidebarEnable || disabled || !sidebarCollapsed"
|
||||
>
|
||||
{{ $t('preferences.sidebar.collapsedShowTitle') }}
|
||||
</SwitchItem>
|
||||
|
Reference in New Issue
Block a user