-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patherror.vue
32 lines (28 loc) · 861 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
<template>
<naive-config>
<div class="page justify-center items-center">
<n-result
:status="status"
:builtin-theme-overrides="{ titleFontSizeMedium: '24px' }"
:title="error.statusMessage || 'Oops, something went wrong'"
:description="error.message"
>
<template #footer>
<n-button
type="primary"
@click="handleError"
>
Back home
</n-button>
</template>
</n-result>
</div>
</naive-config>
</template>
<script setup lang="ts">
import type { ResultProps } from 'naive-ui'
import type { NuxtError } from '#app'
const props = defineProps<{ error: NuxtError }>()
const status = computed(() => props.error.statusCode?.toString() as ResultProps['status'])
const handleError = () => clearError({ redirect: '/' })
</script>