-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherror.vue
60 lines (52 loc) · 1.13 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
54
55
56
57
58
59
60
<script lang="ts" setup>
import { get } from '@vueuse/core';
const error = useError();
const { t } = useI18n();
const css = useCssModule();
const title = computed(() => get(error)?.message ?? '');
const statusCode = computed(() => {
const err = get(error);
return err && 'statusCode' in err ? err.statusCode : -1;
});
const handleError = () => clearError({ redirect: '/' });
useHead(() => ({
title,
}));
</script>
<template>
<div class="container">
<div
v-if="error"
:class="css.wrapper"
>
<h1 :class="css.title">
{{ statusCode }}
</h1>
<p :class="css.subtitle">
{{ title }}
</p>
<div class="flex justify-center">
<RuiButton
variant="default"
size="lg"
filled
color="primary"
@click="handleError()"
>
{{ t('actions.go_back_home') }}
</RuiButton>
</div>
</div>
</div>
</template>
<style module lang="scss">
.wrapper {
@apply text-center my-24;
}
.title {
@apply block text-red-500 font-bold text-6xl;
}
.subtitle {
@apply block font-light text-rui-text my-8 text-3xl;
}
</style>