mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
75 lines
1.5 KiB
Vue
75 lines
1.5 KiB
Vue
<!-- eslint-disable vue/no-v-html -->
|
|
<template>
|
|
<div>
|
|
<NuxtLoadingIndicator />
|
|
|
|
<Banner />
|
|
|
|
<Header />
|
|
|
|
<UContainer>
|
|
<UMain>
|
|
<UPage>
|
|
<UPageError :error="error" />
|
|
</UPage>
|
|
</UMain>
|
|
</UContainer>
|
|
|
|
<Footer />
|
|
|
|
<ClientOnly>
|
|
<LazyUContentSearch :files="files" :navigation="navigation" :fuse="{ resultLimit: 42 }" />
|
|
</ClientOnly>
|
|
|
|
<UNotifications>
|
|
<template #title="{ title }">
|
|
<span v-html="title" />
|
|
</template>
|
|
</UNotifications>
|
|
<UModals />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type { ParsedContent } from '@nuxt/content'
|
|
import type { NuxtError } from '#app'
|
|
|
|
useSeoMeta({
|
|
title: 'Page not found',
|
|
description: 'We are sorry but this page could not be found.'
|
|
})
|
|
|
|
defineProps<{
|
|
error: NuxtError
|
|
}>()
|
|
|
|
const colorMode = useColorMode()
|
|
|
|
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
|
|
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', { default: () => [], server: false })
|
|
|
|
// Computed
|
|
|
|
const color = computed(() => colorMode.value === 'dark' ? '#18181b' : 'white')
|
|
|
|
// Head
|
|
|
|
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' }
|
|
],
|
|
htmlAttrs: {
|
|
lang: 'en'
|
|
}
|
|
})
|
|
|
|
// Provide
|
|
|
|
provide('navigation', navigation)
|
|
provide('files', files)
|
|
</script>
|