-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patherror.vue
38 lines (36 loc) · 1.09 KB
/
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 setup lang="ts">
import type { NuxtError } from "#app";
defineProps({
error: {
type: Object as () => NuxtError,
default: null,
},
});
const handleError = () => clearError({ redirect: "/" });
</script>
é
<template>
<main
class="grid min-h-full place-items-center bg-white px-6 py-24 sm:py-32 lg:px-8"
>
<div class="text-center">
<p class="text-base font-semibold text-indigo-600">Error</p>
<h1
class="mt-4 text-3xl font-bold tracking-tight text-gray-900 sm:text-5xl"
>
{{ error?.statusCode }}
</h1>
<p class="mt-6 text-base leading-7 text-gray-600">
{{ error?.statusMessage }}
</p>
<div class="mt-10 flex items-center justify-center gap-x-6">
<button
@click="handleError"
class="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
>
Go back home
</button>
</div>
</div>
</main>
</template>