-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHeader.vue
43 lines (35 loc) · 1.16 KB
/
Header.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
40
41
42
43
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
const navigation = inject<NavItem[]>('navigation', [])
const { header } = useAppConfig()
</script>
<template>
<UHeader>
<template #logo>
<template v-if="header?.logo?.dark || header?.logo?.light">
<UColorModeImage v-bind="{ class: 'h-6 w-auto', ...header?.logo }" />
</template>
<template v-else>
tRPC Vue-Query
<UBadge label="Docs" variant="subtle" class="mb-0.5" />
</template>
</template>
<template v-if="header?.search" #center>
<UContentSearchButton class="hidden lg:flex" />
</template>
<template #right>
<UContentSearchButton v-if="header?.search" :label="null" class="lg:hidden" />
<UColorModeButton v-if="header?.colorMode" />
<template v-if="header?.links">
<UButton
v-for="(link, index) of header.links"
:key="index"
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
/>
</template>
</template>
<template #panel>
<UNavigationTree :links="mapContentNavigation(navigation)" />
</template>
</UHeader>
</template>