-
Notifications
You must be signed in to change notification settings - Fork 4
/
error.vue
59 lines (52 loc) · 1.49 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
<script setup lang="ts">
import Layout from '~/app.vue'
const error = useError()
const detailDom = ref<HTMLDialogElement | null>(null)
const errorMsg = computed<string | undefined>(() => error.value?.message)
errorAlert(errorMsg.value)
const showDetail = ref(0)
watch(showDetail, (val) => {
if (val > 9) {
detailDom.value?.showModal()
}
})
defineCytoidPage({
title: 'Error',
})
</script>
<template>
<Layout>
<div class="hero my-auto h-full p-0">
<div class="hero-content flex-col p-0 sm:flex-row-reverse">
<img src="/images/sayakacry.webp" class="max-w-screen w-64 sm:max-w-sm" @click="showDetail += 1">
<div class="flex-1" />
<div>
<h1 class="text-5xl font-bold">
{{ $t('general.error_page_title') }}
</h1>
<p class="py-6">
{{ $t('general.error_page_subtitle', { error: errorMsg ?? $t('general.error_page_default_message') }) }}
</p>
<NuxtLink class="btn btn-primary" :to="{ name: 'index' }">
{{ $t('general.nav_home') }}
</NuxtLink>
</div>
</div>
</div>
<dialog ref="detailDom" class="modal">
<form method="dialog" class="modal-box">
<h3 class="text-lg font-bold">
Error Details
</h3>
<p class="py-4">
{{ error }}
</p>
<div class="modal-action">
<button class="btn">
Close
</button>
</div>
</form>
</dialog>
</Layout>
</template>