Skip to content

Commit a22763e

Browse files
committed
fix: export component, mv Result to src/components
1 parent 218e921 commit a22763e

File tree

7 files changed

+115
-102
lines changed

7 files changed

+115
-102
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
<template>
2-
<div class="result">
3-
<div>
4-
<a-icon :class="{ 'icon': true, 'success': isSuccess, 'error': !isSuccess }" :type="isSuccess ? 'check-circle' : 'close-circle'"/>
5-
</div>
6-
<div class="title" v-if="title">{{ title }}</div>
7-
<div class="description" v-if="description">{{ description }}</div>
8-
<div class="content" v-if="content">
9-
<slot></slot>
10-
</div>
11-
<div class="action">
12-
<slot name="action"></slot>
13-
</div>
14-
</div>
15-
</template>
16-
17-
<script>
18-
export default {
19-
name: 'Result',
20-
props: {
21-
isSuccess: {
22-
type: Boolean,
23-
default: false
24-
},
25-
title: {
26-
type: String,
27-
default: ''
28-
},
29-
description: {
30-
type: String,
31-
default: ''
32-
},
33-
content: {
34-
type: Boolean,
35-
default: true
36-
}
37-
}
38-
}
39-
</script>
40-
41-
<style lang="less" scoped>
42-
.result {
43-
text-align: center;
44-
width: 72%;
45-
margin: 0 auto;
46-
padding: 24px 0 8px;
47-
48-
.icon {
49-
font-size: 72px;
50-
line-height: 72px;
51-
margin-bottom: 24px;
52-
}
53-
.success {
54-
color: #52c41a;
55-
}
56-
.error {
57-
color: red;
58-
}
59-
.title {
60-
font-size: 24px;
61-
color: rgba(0, 0, 0, .85);
62-
font-weight: 500;
63-
line-height: 32px;
64-
margin-bottom: 16px;
65-
}
66-
.description {
67-
font-size: 14px;
68-
line-height: 22px;
69-
color: rgba(0, 0, 0, 0.45);
70-
margin-bottom: 24px;
71-
}
72-
.content {
73-
background: #fafafa;
74-
padding: 24px 40px;
75-
border-radius: 2px;
76-
text-align: left;
77-
}
78-
.action {
79-
margin-top: 32px;
80-
}
81-
}
82-
83-
.mobile {
84-
.result {
85-
width: 100%;
86-
margin: 0 auto;
87-
padding: unset;
88-
}
89-
}
1+
<template>
2+
<div class="result">
3+
<div>
4+
<a-icon :class="{ 'icon': true, 'success': isSuccess, 'error': !isSuccess }" :type="isSuccess ? 'check-circle' : 'close-circle'"/>
5+
</div>
6+
<div class="title" v-if="title">{{ title }}</div>
7+
<div class="description" v-if="description">{{ description }}</div>
8+
<div class="content" v-if="content">
9+
<slot></slot>
10+
</div>
11+
<div class="action">
12+
<slot name="action"></slot>
13+
</div>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
name: 'Result',
20+
props: {
21+
isSuccess: {
22+
type: Boolean,
23+
default: false
24+
},
25+
title: {
26+
type: String,
27+
default: ''
28+
},
29+
description: {
30+
type: String,
31+
default: ''
32+
},
33+
content: {
34+
type: Boolean,
35+
default: true
36+
}
37+
}
38+
}
39+
</script>
40+
41+
<style lang="less" scoped>
42+
.result {
43+
text-align: center;
44+
width: 72%;
45+
margin: 0 auto;
46+
padding: 24px 0 8px;
47+
48+
.icon {
49+
font-size: 72px;
50+
line-height: 72px;
51+
margin-bottom: 24px;
52+
}
53+
.success {
54+
color: #52c41a;
55+
}
56+
.error {
57+
color: red;
58+
}
59+
.title {
60+
font-size: 24px;
61+
color: rgba(0, 0, 0, .85);
62+
font-weight: 500;
63+
line-height: 32px;
64+
margin-bottom: 16px;
65+
}
66+
.description {
67+
font-size: 14px;
68+
line-height: 22px;
69+
color: rgba(0, 0, 0, 0.45);
70+
margin-bottom: 24px;
71+
}
72+
.content {
73+
background: #fafafa;
74+
padding: 24px 40px;
75+
border-radius: 2px;
76+
text-align: left;
77+
}
78+
.action {
79+
margin-top: 32px;
80+
}
81+
}
82+
83+
.mobile {
84+
.result {
85+
width: 100%;
86+
margin: 0 auto;
87+
padding: unset;
88+
}
89+
}
9090
</style>

β€Žsrc/components/Result/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Result from './Result.vue'
2+
export default Result

β€Žsrc/components/index.js

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import AvatarList from '@/components/AvatarList/index'
21
// chart
32
import Bar from '@/components/chart/Bar'
43
import ChartCard from '@/components/chart/ChartCard'
@@ -9,13 +8,20 @@ import MiniProgress from '@/components/chart/MiniProgress'
98
import Radar from '@/components/chart/Radar'
109
import RankList from '@/components/chart/RankList'
1110
import TransferBar from '@/components/chart/TransferBar'
12-
// ------ζˆ‘ζ˜―εˆ†ε‰²ηΊΏ----------
13-
import CountDown from '@/components/CountDown/index'
14-
import Ellipsis from '@/components/Ellipsis/index'
15-
import FooterToolbar from '@/components/FooterToolbar/index'
16-
import NumberInfo from '@/components/NumberInfo/index'
11+
12+
// pro components
13+
import AvatarList from '@/components/AvatarList'
14+
import CountDown from '@/components/CountDown'
15+
import Ellipsis from '@/components/Ellipsis'
16+
import FooterToolbar from '@/components/FooterToolbar'
17+
import NumberInfo from '@/components/NumberInfo'
18+
import DetailList from '@/components/tools/DetailList'
1719
import Tree from '@/components/Tree/Tree'
18-
import Trend from '@/components/Trend/index'
20+
import Trend from '@/components/Trend'
21+
import STable from '@/components/table'
22+
import MultiTab from '@/components/MultiTab'
23+
import Result from '@/components/Result'
24+
import IconSelector from '@/components/IconSelector'
1925

2026
export {
2127
AvatarList,
@@ -33,5 +39,10 @@ export {
3339
Ellipsis,
3440
FooterToolbar,
3541
NumberInfo,
36-
Tree
42+
DetailList,
43+
Tree,
44+
STable,
45+
MultiTab,
46+
Result,
47+
IconSelector
3748
}

β€Žsrc/views/form/stepForm/Step3.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</template>
3131

3232
<script>
33-
import Result from '../../result/Result'
33+
import { Result } from '@/components'
3434
3535
export default {
3636
name: 'Step3',
@@ -66,4 +66,4 @@ export default {
6666
font-size: 20px;
6767
line-height: 14px;
6868
}
69-
</style>
69+
</style>

β€Žsrc/views/result/Error.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</template>
2525

2626
<script>
27-
import Result from './Result'
27+
import { Result } from '@/components'
2828
2929
export default {
3030
name: 'Error',

β€Žsrc/views/result/Success.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</template>
6161

6262
<script>
63-
import Result from './Result'
63+
import { Result } from '@/components'
6464
import { mixinDevice } from '@/utils/mixin.js'
6565
6666
const directionType = {

β€Žsrc/views/user/RegisterResult.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</template>
1515

1616
<script>
17-
import Result from '@/views/result/Result'
17+
import { Result } from '@/components'
1818
1919
export default {
2020
name: 'RegisterResult',

0 commit comments

Comments
Β (0)