feat(home): 修复主页显示异常
- 修复主页显示的问题,导航栏不正确高亮
This commit is contained in:
@@ -37,9 +37,14 @@ const navigation = ref([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// 当前的 nav
|
// 当前的 nav
|
||||||
const currentNav = computed(() =>
|
const currentNav = computed(() => {
|
||||||
navigation.value.find((item) => item?.link?.path === route.fullPath)
|
// 第一种方式
|
||||||
);
|
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);
|
const activeTab = ref(currentNav.value?.title);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user