feat: add breadcrumb navigation example

This commit is contained in:
vince
2024-07-19 01:26:13 +08:00
parent 0c245665a9
commit 9ec91ac16d
24 changed files with 188 additions and 75 deletions

View File

@@ -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 },
);
// 初始化计算侧边菜单