forked from ffplayout/ffplayout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.vue
44 lines (40 loc) · 1.22 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
<template>
<NuxtLayout>
<div class="w-full h-full flex justify-center items-center mt-20">
<div v-if="props.error?.statusCode === 404">
<h1 class="text-center text-6xl">404</h1>
<p class="text-center font-bold mt-6">
{{ t('error.notFound') }}
</p>
</div>
<div v-else-if="props.error?.statusCode === 500">
<h1 class="text-center text-6xl">{{ props.error.statusCode }}</h1>
<p class="text-center font-bold mt-6">
{{ t('error.serverError') }}
</p>
</div>
</div>
</NuxtLayout>
</template>
<script setup lang="ts">
import type { NuxtError } from '#app'
const { t } = useI18n()
const localePath = useLocalePath()
const props = defineProps({
error: {
type: Object,
default: {} as NuxtError,
},
})
// onMounted(() => {
// const statusCode = props.error?.statusCode || 400
// if (statusCode >= 400) {
// setTimeout(() => {
// reloadNuxtApp({
// path: localePath({ name: 'index' }),
// ttl: 1000,
// })
// }, 3000)
// }
// })
</script>