-
Notifications
You must be signed in to change notification settings - Fork 1
/
error.vue
executable file
·34 lines (32 loc) · 986 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
<template>
<NuxtLayout>
<div class="prose" v-if="error">
<template v-if="error.statusCode === 404">
<h1>404!</h1>
<p style="color:#cf0aed">Sorry, that page doesn't exist.</p>
</template>
<template v-else>
<h1>Gulp!</h1>
<p style="color:#e8154a">
<strong>{{ error.message }}</strong>
</p>
<p>It looks like something broke.</p>
<p>Sorry about that.</p>
</template>
<!--p style="color:#41f07b"-->
<button class="text-sm bg-green-500 text-black font-bold underline py-2 px-4 rounded" @click="handleError">
Go back to main page.
</button>
<!--/p-->
</div>
</NuxtLayout>
</template>
<script setup>
const error = useError()
const handleError = () => {
clearError({
redirect:
'/'
})
}
</script>