feat(home): 修复主页显示异常

- 修复主页显示的问题,导航栏不正确高亮
This commit is contained in:
Huangzhe
2025-05-22 19:29:03 +08:00
parent 9b405b7cc9
commit 056b09c7c0

View File

@@ -37,9 +37,14 @@ const navigation = ref([
]);
// 当前的 nav
const currentNav = computed(() =>
navigation.value.find((item) => item?.link?.path === route.fullPath)
);
const currentNav = computed(() => {
// 第一种方式
const nav = navigation.value.find((item) => item?.link?.path === route.fullPath);
// 第二种方式
// const nav = navigation.value.find((item) => item?.link?.path === window.location.pathname);
return nav;
});
const activeTab = ref(currentNav.value?.title);
/**