-
Notifications
You must be signed in to change notification settings - Fork 1
/
error.vue
66 lines (59 loc) · 1.04 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
63
64
65
66
<template>
<div class="page-not-found">
<h2>{{ error.statusCode }}</h2>
<div class="reason">
{{ error.message }}
</div>
<button
class="btn-back"
aria-label="button"
@click="handleError"
>
返回首页
</button>
</div>
</template>
<script setup lang="ts">
defineProps<{
error: {
url: string
statusCode: number
statusMessage: string
message: string
description: string
data: any
}
}>()
const handleError = () => clearError({ redirect: '/' })
</script>
<style lang="scss" scoped>
.page-not-found {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 8vh;
width: 100vw;
height: 100vh;
h2 {
font-size: 8vw;
color: var(--red);
}
.reason {
font-size: 4vw;
}
.btn-back {
width: 80vw;
height: 10vh;
font-size: 2vw;
color: var(--white);
border: 0;
border-radius: 1vw;
background-color: var(--primary-color);
cursor: pointer;
&:hover {
opacity: .9;
}
}
}
</style>