ffplayout/frontend/error.vue

44 lines
1.2 KiB
Vue
Raw Normal View History

2024-02-16 06:06:15 -05:00
<template>
<NuxtLayout>
2024-04-11 15:34:03 -04:00
<div class="w-full h-full flex justify-center items-center mt-20">
2024-02-16 06:06:15 -05:00
<div v-if="props.error?.statusCode === 404">
2024-04-11 15:34:03 -04:00
<h1 class="text-center text-6xl">404</h1>
<p class="text-center font-bold mt-6">
{{ $t('error.notFound') }}
</p>
2024-02-16 06:06:15 -05:00
</div>
<div v-else-if="props.error?.statusCode === 500">
2024-04-11 15:34:03 -04:00
<h1 class="text-center text-6xl">{{ props.error.statusCode }}</h1>
<p class="text-center font-bold mt-6">
{{ $t('error.serverError') }}
</p>
2024-02-16 06:06:15 -05:00
</div>
</div>
</NuxtLayout>
</template>
<script setup lang="ts">
import type { NuxtError } from '#app'
2024-04-11 15:34:03 -04:00
const localePath = useLocalePath()
2024-02-16 06:06:15 -05:00
const props = defineProps({
2024-04-16 12:13:28 -04:00
error: {
type: Object,
default: {} as NuxtError,
},
2024-02-16 06:06:15 -05:00
})
2024-04-25 08:49:57 -04:00
// onMounted(() => {
// const statusCode = props.error?.statusCode || 400
2024-02-16 06:06:15 -05:00
2024-04-25 08:49:57 -04:00
// if (statusCode >= 400) {
// setTimeout(() => {
// reloadNuxtApp({
// path: localePath({ name: 'index' }),
// ttl: 1000,
// })
// }, 3000)
// }
// })
2024-02-16 06:06:15 -05:00
</script>