-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.vue
49 lines (43 loc) · 1.15 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
<template>
<div
class="container min-vh-80 d-flex justify-content-center align-items-center error-page"
>
<div class="row shadow p-3 mb-5 bg-white rounded m-5">
<div class="col-12 col-sm-12 col-md-6">
<h1 class="text-primaryOeb-500">{{ error?.statusCode }}</h1>
<h2>Whoops!</h2>
<p v-if="error?.statusCode === 404">
{{ pageNotFound }}
</p>
<p v-else>
{{ otherError }}
</p>
<br />
<UButton @click="handleError">Go back home</UButton>
</div>
<div class="col-12 col-sm-12 col-md-6">
<CommunityImg />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { NuxtError } from "#app";
import CommunityImg from "./public/images/illustrations/chart-person.svg?component";
defineProps({
error: Object as () => NuxtError,
});
const otherError = "An error occurred";
const pageNotFound =
"Sorry to say, but it looks like this page does not exist.";
const handleError = () => clearError({ redirect: "/" });
</script>
<style>
.min-vh-80 {
min-height: 80vh;
}
.error-page svg {
max-width: 400px;
max-height: 350px;
}
</style>