-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
error.vue
38 lines (33 loc) · 889 Bytes
/
error.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
<script lang="ts" setup>
import type { NuxtError } from 'nuxt/app'
defineProps({
error: Object as () => NuxtError,
})
const { public: { appName } } = useConfig()
useHead({
titleTemplate: () => `Error Page | ${appName}`,
})
const handle = () => {
clearError({
redirect: '/',
})
}
</script>
<template>
<AppLayout name="minimal">
<div class="flex flex-col items-center gap-8">
<template v-if="error">
<template v-if="error?.statusCode === 404">
<h1 class="font-bold text-2xl text-center">404</h1>
<p v-if="error">
{{ error.message }}
</p>
</template>
<template v-else>
<h1 class="font-bold text-2xl text-center">Unknown error</h1>
</template>
</template>
<CoreButton class="border border-layer" @click="handle">Home</CoreButton>
</div>
</AppLayout>
</template>