forked from who-jonson/sakai-nuxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.vue
38 lines (32 loc) · 855 Bytes
/
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
<script lang="ts" setup>
interface ErrorProps {
error: {
description?: string,
message?: string,
statusCode: string,
statusMessage: string,
url: string
};
}
const { error } = defineProps<ErrorProps>();
const component = computed(() => {
if (parseInt(error.statusCode) === 403) {
return defineAsyncComponent(() => import('~/components/layouts/error/AccessDenied.vue'));
}
return parseInt(error.statusCode) === 404
? defineAsyncComponent(() => import('~/components/layouts/error/NotFound.vue'))
: defineAsyncComponent(() => import('~/components/layouts/error/ServerError.vue'));
});
definePageMeta({
layout: 'empty',
title: 'Error'
});
</script>
<template>
<div>
<Head>
<Title>{{ error.statusMessage }}</Title>
</Head>
<Component :is="component" :error="error" />
</div>
</template>