-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.vue
More file actions
30 lines (30 loc) · 751 Bytes
/
error.vue
File metadata and controls
30 lines (30 loc) · 751 Bytes
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
<template>
<NuxtLayout>
<div
class="d-flex flex-column align-items-center justify-content-center h-100"
>
<template v-if="error.statusCode === 404">
<h1>404!</h1>
<p>{{ $t("page-not-found-explanation") }}</p>
</template>
<template v-else>
<h1>{{ $t("error-occured") }}</h1>
<p>
<strong>{{ error.message }}</strong>
</p>
<p>{{ $t("error-explanation") }}</p>
</template>
<button type="button" class="btn btn-primary" @click="handleError">
{{ $t("go-back-home") }}
</button>
</div>
</NuxtLayout>
</template>
<script setup>
const error = useError();
const handleError = () => {
clearError({
redirect: "/",
});
};
</script>