diff --git a/src/components/Navigation/Index.vue b/src/components/Navigation/Index.vue index e62eed8..4ffc1b0 100644 --- a/src/components/Navigation/Index.vue +++ b/src/components/Navigation/Index.vue @@ -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); /**