generated from nuxtbase/nuxt3-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patherror.vue
53 lines (47 loc) · 1.51 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
<NuxtLayout>
<div class="flex justify-center items-center h-full">
<div class="mx-auto flex max-w-sm flex-col items-center text-center">
<p
class="rounded-full bg-neutral-100 p-3 text-sm font-medium dark:bg-neutral-800"
>
<Icon name="ri:alarm-warning-line" class="h-6 w-6" />
</p>
<h1
class="mt-3 text-2xl font-semibold text-neutral-800 dark:text-white md:text-3xl"
>
Page not found
</h1>
<p class="mt-4 text-neutral-500 dark:text-neutral-400">
The page you are looking for doesn't exist.
</p>
<div
class="group mt-6 flex w-full shrink-0 items-center gap-x-3 sm:w-auto"
>
<Button
@click="() => router.back()"
:class="buttonVariants({ variant: 'secondary' })"
>
<Icon
name="ri:arrow-left-line"
class="h-4 w-4 transition-transform group-hover:-translate-x-1 mr-1"
/>
<span>Go back</span>
</Button>
<NuxtLink href="/" :class="buttonVariants({ variant: 'default' })">
Take me home
</NuxtLink>
</div>
</div>
</div>
</NuxtLayout>
</template>
<script setup lang="ts">
import type { NuxtError } from '#app'
import { buttonVariants } from '@/components/ui/button'
const router = useRouter()
defineProps({
error: Object as () => NuxtError
})
const handleError = () => clearError({ redirect: '/' })
</script>