forked from ChanWahFung/nuxt-juejin-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.vue
More file actions
137 lines (125 loc) · 2.71 KB
/
Copy patherror.vue
File metadata and controls
137 lines (125 loc) · 2.71 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<template>
<div class="error-page">
<div class="error">
<div class="where-is-panfish">
<img class="elem bg" src="https://b-gold-cdn.xitu.io/v3/static/img/bg.1f516b3.png">
<img class="elem panfish" src="https://b-gold-cdn.xitu.io/v3/static/img/panfish.9be67f5.png">
<img class="elem sea" src="https://b-gold-cdn.xitu.io/v3/static/img/sea.892cf5d.png">
<img class="elem spray" src="https://b-gold-cdn.xitu.io/v3/static/img/spray.bc638d2.png">
</div>
<div class="title">{{statusCode}} - {{ message }}</div>
<nuxt-link class="error-link" to="/">回到首页</nuxt-link>
</div>
</div>
</template>
<script>
export default {
props: {
error: {
type: Object,
default: null
}
},
computed: {
statusCode () {
return (this.error && this.error.statusCode) || 500
},
message () {
return this.error.message || 'Error'
}
},
head () {
return {
title: `${this.statusCode === 404 ? '找不到页面' : '呈现页面出错'} - 掘金`,
meta: [
{
name: 'viewport',
content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no'
}
]
}
}
}
</script>
<style lang="scss" scoped>
.error-page {
padding: 1rem;
background: #F7F8FB;
color: #47494E;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-family: sans-serif;
font-weight: 100 !important;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
.error {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 960px;
}
.title {
font-size: 1.5rem;
margin-top: 15px;
color: #47494E;
margin-bottom: 8px;
}
}
.error-link{
display: block;
margin-top: 24px;
padding: 14px 24px;
font-size: 18px;
color: #fff;
background-color: $theme;
border-radius: 5px;
}
.where-is-panfish{
position: relative;
width: 624px;
max-width: 70%;
padding-top: 48%;
.elem{
position: absolute;
top: 35%;
left: 50%;
}
.bg{
width: 77.724%;
transform: translate(-50%,-50%);
}
.panfish{
width: 20.994%;
transform: translate(-55%,32%);
animation: panfish 2s ease-in-out infinite alternate;
}
.sea{
width: 99.199%;
transform: translate(-50%,75.3%);
opacity: .7;
}
.spray{
width: 40.545%;
transform: translate(-55%,162%);
opacity: .4;
}
}
@keyframes panfish {
0% {
transform: translate(-55%,30%);
}
100% {
transform: translate(-55%,36%);
}
}
</style>