-
-
Notifications
You must be signed in to change notification settings - Fork 673
/
Copy pathapp.vue
61 lines (50 loc) · 1.33 KB
/
app.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<script setup lang="ts">
import { withoutTrailingSlash } from 'ufo'
const route = useRoute()
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'), {
transform: data => data.find(item => item.path === '/docs')?.children || [],
})
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
server: false,
})
const links = useNavLinks()
const color = useThemeColor()
useHead({
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ key: 'theme-color', name: 'theme-color', content: color },
],
link: [
{ rel: 'icon', type: 'image/svg+xml', href: '/icon.svg' },
{ rel: 'canonical', href: `https://content.nuxt.com${withoutTrailingSlash(route.path)}` },
],
htmlAttrs: {
lang: 'en',
},
})
useServerSeoMeta({
ogSiteName: 'Nuxt Content',
twitterCard: 'summary_large_image',
})
provide('navigation', navigation)
</script>
<template>
<UApp>
<NuxtLoadingIndicator color="#FFF" />
<AppHeader />
<UMain>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</UMain>
<AppFooter />
<ClientOnly>
<LazyUContentSearch
:links="links"
:files="files"
:navigation="navigation"
:fuse="{ resultLimit: 42 }"
/>
</ClientOnly>
</UApp>
</template>