Skip to content

Commit cfc3bbc

Browse files
committed
reactor: v2: ExceptionPage move to components/
1 parent c5cdf68 commit cfc3bbc

File tree

7 files changed

+94
-90
lines changed

7 files changed

+94
-90
lines changed
Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
1-
<template>
2-
<div class="exception">
3-
<div class="img">
4-
<img :src="config[type].img"/>
5-
</div>
6-
<div class="content">
7-
<h1>{{ config[type].title }}</h1>
8-
<div class="desc">{{ config[type].desc }}</div>
9-
<div class="action">
10-
<a-button type="primary" @click="handleToHome">返回首页</a-button>
11-
</div>
12-
</div>
13-
</div>
14-
</template>
15-
16-
<script>
17-
import types from './type'
18-
19-
export default {
20-
name: 'Exception',
21-
props: {
22-
type: {
23-
type: String,
24-
default: '404'
25-
}
26-
},
27-
data () {
28-
return {
29-
config: types
30-
}
31-
},
32-
methods: {
33-
handleToHome () {
34-
this.$router.push({ name: 'dashboard' })
35-
}
36-
}
37-
}
38-
</script>
39-
40-
<style lang="less" scoped>
41-
.exception {
42-
min-height: 500px;
43-
height: 80%;
44-
align-items: center;
45-
text-align: center;
46-
margin-top: 150px;
47-
.img {
48-
display: inline-block;
49-
padding-right: 52px;
50-
zoom: 1;
51-
img {
52-
height: 360px;
53-
max-width: 430px;
54-
}
55-
}
56-
.content {
57-
display: inline-block;
58-
flex: auto;
59-
h1 {
60-
color: #434e59;
61-
font-size: 72px;
62-
font-weight: 600;
63-
line-height: 72px;
64-
margin-bottom: 24px;
65-
}
66-
.desc {
67-
color: rgba(0, 0, 0, .45);
68-
font-size: 20px;
69-
line-height: 28px;
70-
margin-bottom: 16px;
71-
}
72-
}
73-
}
74-
75-
.mobile {
76-
.exception {
77-
margin-top: 30px;
78-
.img {
79-
padding-right: unset;
80-
81-
img {
82-
height: 40%;
83-
max-width: 80%;
84-
}
85-
}
86-
}
87-
}
1+
<template>
2+
<div class="exception">
3+
<div class="img">
4+
<img :src="config[type].img"/>
5+
</div>
6+
<div class="content">
7+
<h1>{{ config[type].title }}</h1>
8+
<div class="desc">{{ config[type].desc }}</div>
9+
<div class="action">
10+
<a-button type="primary" @click="handleToHome">返回首页</a-button>
11+
</div>
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script>
17+
import types from './type'
18+
19+
export default {
20+
name: 'Exception',
21+
props: {
22+
type: {
23+
type: String,
24+
default: '404'
25+
}
26+
},
27+
data () {
28+
return {
29+
config: types
30+
}
31+
},
32+
methods: {
33+
handleToHome () {
34+
this.$router.push({ name: 'dashboard' })
35+
}
36+
}
37+
}
38+
</script>
39+
40+
<style lang="less" scoped>
41+
.exception {
42+
min-height: 500px;
43+
height: 80%;
44+
align-items: center;
45+
text-align: center;
46+
margin-top: 150px;
47+
.img {
48+
display: inline-block;
49+
padding-right: 52px;
50+
zoom: 1;
51+
img {
52+
height: 360px;
53+
max-width: 430px;
54+
}
55+
}
56+
.content {
57+
display: inline-block;
58+
flex: auto;
59+
h1 {
60+
color: #434e59;
61+
font-size: 72px;
62+
font-weight: 600;
63+
line-height: 72px;
64+
margin-bottom: 24px;
65+
}
66+
.desc {
67+
color: rgba(0, 0, 0, .45);
68+
font-size: 20px;
69+
line-height: 28px;
70+
margin-bottom: 16px;
71+
}
72+
}
73+
}
74+
75+
.mobile {
76+
.exception {
77+
margin-top: 30px;
78+
.img {
79+
padding-right: unset;
80+
81+
img {
82+
height: 40%;
83+
max-width: 80%;
84+
}
85+
}
86+
}
87+
}
8888
</style>

src/components/Exception/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import ExceptionPage from './ExceptionPage.vue'
2+
export default ExceptionPage
File renamed without changes.

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import STable from '@/components/Table'
2222
import MultiTab from '@/components/MultiTab'
2323
import Result from '@/components/Result'
2424
import IconSelector from '@/components/IconSelector'
25+
import ExceptionPage from '@/components/Exception'
2526

2627
export {
2728
AvatarList,
@@ -46,5 +47,6 @@ export {
4647
STable,
4748
MultiTab,
4849
Result,
50+
ExceptionPage,
4951
IconSelector
5052
}

src/views/exception/403.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</template>
44

55
<script>
6-
import ExceptionPage from './ExceptionPage'
6+
import { ExceptionPage } from '@/components'
77
88
export default {
99
components: {

src/views/exception/404.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</template>
44

55
<script>
6-
import ExceptionPage from './ExceptionPage'
6+
import { ExceptionPage } from '@/components'
77
88
export default {
99
components: {

src/views/exception/500.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</template>
44

55
<script>
6-
import ExceptionPage from './ExceptionPage'
6+
import { ExceptionPage } from '@/components'
77
88
export default {
99
components: {

0 commit comments

Comments
 (0)