-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.vue
62 lines (56 loc) · 1.62 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
61
62
<script setup lang="ts">
import '@/assets/css/slide-enter.sass'
import '@/assets/css/underlined.sass'
interface RootError {
statusCode?: number
statusMessage?: string
message?: string
}
const { error } = defineProps<{ error: RootError }>()
useSeoMetaHelper({
title: error.statusMessage || `Error ${error.statusCode}`,
description: error.message || 'Undefined error',
})
</script>
<template>
<div m-0 flex flex-grow flex-col p-0>
<NuxtLayout>
<div class="slide-enter" m-a text-gray-700 lt-md:w-90vw md:w-60ch dark:text-gray-200>
<p m-block-0 text-10>
{{ error?.statusMessage || `Error ${error.statusCode}` }}
</p>
<p m-block-0>
At location: <span text-sm font-mono class="location">{{ useRouter().currentRoute.value.path }}</span>
</p>
<p m-block-0 text-sm>
Note: The current location maybe different from the error one
</p>
<div mt-2 :if="error.message">
With message:
<div class="reason" break-words text-sm font-mono>
{{ error.message || '<undefined>' }}
</div>
</div>
<p m-block-0>
In case if you have some time, you can
<NuxtLink
class="underlined"
href="https://github.com/Helltraitor/helltraitor.github.io/issues/new"
target="_blank"
>
report issue
</NuxtLink>
</p>
</div>
</NuxtLayout>
</div>
</template>
<style scoped lang="sass">
main
width: min(60ch, 90vw)
.location,
.reason
background-color: var(--c-bg-code)
border-radius: 0.25rem
padding: 0.10rem
</style>