-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTheSidebar.vue
39 lines (37 loc) · 1.07 KB
/
TheSidebar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<script lang="ts" setup async>
import { CStack } from '@chakra-ui/vue-next'
import DocLink from '~/components/navigation/DocLink.vue'
/**
* Documentation Fetching
*/
const { data: navigation } = await useAsyncData('navigation', () =>
fetchContentNavigation()
)
</script>
<template>
<CStack v-if="navigation" as="ul" spacing="0" list-style-type="none" font-size="sm">
<li v-for="(item, index) in navigation" :key="index">
<DocLink :nav-item-path="item._path">
{{ item.title }}
</DocLink>
<!-- <AppNavigation v-if="item.children" :navigation-tree="item.children" class="sub-navigation" /> -->
<CStack
v-if="item?.children?.length"
as="ul"
spacing="0"
list-style-type="none"
>
<DocLink
v-for="nestedItem in item.children.filter(
(_) => _._path !== item._path
)"
:key="`path:${nestedItem._path}`"
:nav-item-path="nestedItem._path"
pl="4"
>
{{ nestedItem.title }}
</DocLink>
</CStack>
</li>
</CStack>
</template>