-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patherror.vue
71 lines (71 loc) · 1.92 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
67
68
69
70
71
<script setup lang="ts">
import config from './config'
definePageMeta({
layout: 'custom', // 不使用default布局
})
const props = defineProps({
error: {
type: Object,
default: () => ({}),
},
})
if (props.error.statusCode) {
await navigateTo('/404')
}
const handleError = () => clearError({ redirect: '/', })
// console.log(props.error)
</script>
<template>
<div class="common-page">
<div class="img-wrap" :style="{ 'background-image': `url(${config.gifError})` }" />
<div class="b-text text-center">
<div class="gradient-text flex justify-center">
<span class="mr-2">{{ error.statusCode }}</span>
<span class="mr-2">{{ error.statusMessage }}</span>
<span class="mr-2">{{ error.url }}</span>
</div>
<div
class="gradient-text text-xl px-8 sm:px-0 sm:text-4xl md:mb-6 font-light h-11 leading-none"
>
{{ error.message }}
</div>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="text-left text-sm mb-3 w-3/4 whitespace-pre-wrap" v-html="error.stack" />
<div class="w-full flex items-center justify-center">
<xia-button @click="handleError">Try Again</xia-button>
</div>
</div>
</div>
</template>
<style lang="less" scoped>
.common-page {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
// justify-content: center;
flex-direction: column;
position: relative;
overflow: hidden;
&::after {
pointer-events: none;
content: '';
position: absolute;
bottom: -30vh;
left: 0;
height: 40vh;
width: 100%;
background: linear-gradient(45deg, #00dc82 0%, #36e4da 50%, #0047e1 100%);
filter: blur(20vh);
}
.img-wrap {
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 50%;
height: 40vh;
}
.b-text {
}
}
</style>