Skip to content

Commit

Permalink
update navtree
Browse files Browse the repository at this point in the history
  • Loading branch information
arkhaiel committed Sep 26, 2024
1 parent 50de95a commit b34de97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<template #header>
<UContentSearchButton label="Recherche..." />
</template>
<UNavigationTree :links="mapContentNavigation(path == '/' ? navigation : navigation.filter(el => el._path == '/'+path.split('/')[1]) || [])" :multiple="path == '/' ? false : true" :default-open="false" />
<UNavigationTree :links="mapContentNavigation(path == '/' ? navigation ?? [] : localNav)" :multiple="path == '/' ? false : true" :default-open="false" />
<template #footer>
<UserDropdown />
</template>
Expand Down Expand Up @@ -56,6 +56,7 @@
<script lang="ts" setup>
const path = computed(() => useRoute().path)
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
const localNav = computed(() => (navigation.value ?? []).filter(el => el._path == '/' + path.value.split('/')[1]) || [])
const { data: page } = await useAsyncData('page', () => queryContent(useRoute().path).findOne() || undefined, { watch: [path] })
const { data: files } = useLazyFetch('/api/search.json', { default: () => [], server: false })
Expand Down

0 comments on commit b34de97

Please sign in to comment.