vdesign-ui 0.1.22 → 0.1.24-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/activityviews/index.vue +13 -11
- package/dist/components/button/index.vue +1 -1
- package/dist/components/checkbox/index.vue +0 -26
- package/dist/components/dropdown/index.vue +72 -69
- package/dist/components/dropdown/style.less +23 -1
- package/dist/components/empty/404-dark.png +0 -0
- package/dist/components/empty/404.png +0 -0
- package/dist/components/empty/index.vue +30 -2
- package/dist/components/empty/network-dark.png +0 -0
- package/dist/components/empty/network.png +0 -0
- package/dist/components/empty/nocoupons-dark.png +0 -0
- package/dist/components/empty/nocoupons.png +0 -0
- package/dist/components/empty/nodata-dark.png +0 -0
- package/dist/components/empty/nodata.png +0 -0
- package/dist/components/empty/nomargin-dark.png +0 -0
- package/dist/components/empty/nomargin.png +0 -0
- package/dist/components/empty/nonotice-dark.png +0 -0
- package/dist/components/empty/nonotice.png +0 -0
- package/dist/components/empty/noocomments-dark.png +0 -0
- package/dist/components/empty/noocomments.png +0 -0
- package/dist/components/empty/noorders-dark.png +0 -0
- package/dist/components/empty/noorders.png +0 -0
- package/dist/components/empty/noposition-dark.png +0 -0
- package/dist/components/empty/noposition.png +0 -0
- package/dist/components/empty/nosearch-dark.png +0 -0
- package/dist/components/empty/nosearch.png +0 -0
- package/dist/components/footer/index.vue +1 -1
- package/dist/components/footnav/footnav-item/index.vue +2 -6
- package/dist/components/icon/font/iconfont.css +59 -949
- package/dist/components/icon/font/iconfont.js +1 -1
- package/dist/components/input/index.vue +31 -8
- package/dist/components/input/style.less +0 -1
- package/dist/components/loading/img_status_loading_white_ani.svg +155 -0
- package/dist/components/loading/img_status_refresh_ani.svg +158 -0
- package/dist/components/loading/index.vue +4 -3
- package/dist/components/loading/style.less +1 -1
- package/dist/components/mixins/clickoutside.js +81 -81
- package/dist/components/pagebreak/index.vue +11 -5
- package/dist/components/radio/index.vue +3 -7
- package/dist/components/radio/style.css +213 -0
- package/dist/components/radio/style.less +5 -0
- package/dist/components/result/index.vue +1 -2
- package/dist/components/selector/index.vue +64 -31
- package/dist/components/selector/style.less +10 -0
- package/dist/components/slider/index.vue +0 -6
- package/dist/components/title/index.vue +1 -1
- package/dist/components/upload/index.vue +67 -189
- package/dist/img/img_status_loading_white_ani.b56fcfae.svg +155 -0
- package/dist/img/img_status_refresh_ani.d0e59f12.svg +158 -0
- package/dist/token.css +10 -2
- package/dist/vdesign-ui.common.js +888 -795
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +888 -795
- package/dist/vdesign-ui.umd.min.js +3 -3
- package/package.json +1 -1
- package/dist/components/loading/loading.png +0 -0
- package/dist/components/loading/refresh.png +0 -0
- package/dist/img/404-dark.775df5bb.png +0 -0
- package/dist/img/network-dark.11a147bb.png +0 -0
- package/dist/img/nodata-dark.b0ea0e39.png +0 -0
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
<input type="radio" :class="inputClasses" :disabled="disabled" :checked="currentValue" @change="change">
|
|
6
6
|
</span>
|
|
7
7
|
<div class="vd-radio__label" v-if="$slots.default">
|
|
8
|
-
<
|
|
8
|
+
<div class="vd-radio__text">
|
|
9
9
|
<slot></slot>
|
|
10
|
-
</
|
|
11
|
-
<p class="vd-radio__description" v-if="extra">{{ extra }}</p>
|
|
10
|
+
</div>
|
|
11
|
+
<!-- <p class="vd-radio__description" v-if="extra">{{ extra }}</p> -->
|
|
12
12
|
</div>
|
|
13
13
|
</label>
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
<!-- 传入文字小icon 不传文字大icon -->
|
|
17
16
|
<label class="vd-radio vd-radio-button" :class="radioButtonClasses" v-else>
|
|
18
17
|
<input type="radio" :class="inputClasses" :disabled="disabled" :checked="currentValue" @change="change">
|
|
19
18
|
<span class="vd-radio-button-text">
|
|
@@ -36,9 +35,6 @@ export default {
|
|
|
36
35
|
type: Boolean,
|
|
37
36
|
default: false
|
|
38
37
|
},
|
|
39
|
-
extra: {
|
|
40
|
-
type: [String, Number, Boolean],
|
|
41
|
-
},
|
|
42
38
|
value: {
|
|
43
39
|
type: [String, Number, Boolean],
|
|
44
40
|
default: false
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
.vd-radio {
|
|
2
|
+
position: relative;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
display: flex;
|
|
5
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
6
|
+
}
|
|
7
|
+
.vd-radio__input {
|
|
8
|
+
position: relative;
|
|
9
|
+
margin-inline-end: calc(var(--spacing-check_radio-icon-margin_right) * 1px);
|
|
10
|
+
width: calc(var(--icon-check_radio-sizing) * 1px);
|
|
11
|
+
height: calc(var(--icon-check_radio-sizing) * 1px);
|
|
12
|
+
}
|
|
13
|
+
.vd-radio__label {
|
|
14
|
+
flex: 1;
|
|
15
|
+
}
|
|
16
|
+
.vd-radio__text {
|
|
17
|
+
color: var(--color-check_radio-text-default);
|
|
18
|
+
font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
|
|
19
|
+
font-weight: var(--en-single-f-d-r-fontWeight);
|
|
20
|
+
}
|
|
21
|
+
.vd-radio__description {
|
|
22
|
+
line-height: 1;
|
|
23
|
+
margin-top: calc(var(--spacing-check_radio-text-margin_top) * 1px);
|
|
24
|
+
color: var(--color-check_radio-text_describe-default);
|
|
25
|
+
font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
26
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
27
|
+
}
|
|
28
|
+
.vd-radio .vd-radio__icon {
|
|
29
|
+
display: block;
|
|
30
|
+
width: calc(var(--icon-check_radio-sizing) * 1px);
|
|
31
|
+
height: calc(var(--icon-check_radio-sizing) * 1px);
|
|
32
|
+
position: relative;
|
|
33
|
+
}
|
|
34
|
+
.vd-radio .vd-radio__icon::before {
|
|
35
|
+
position: absolute;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
content: ' ';
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
top: -50%;
|
|
40
|
+
right: -50%;
|
|
41
|
+
bottom: -50%;
|
|
42
|
+
left: -50%;
|
|
43
|
+
border: 0 solid var(--color-check_radio-default);
|
|
44
|
+
-webkit-transform: scale(0.5);
|
|
45
|
+
transform: scale(0.5);
|
|
46
|
+
border-width: 3px;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
}
|
|
49
|
+
.vd-radio__original {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
left: 0;
|
|
56
|
+
right: 0;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
60
|
+
opacity: 0;
|
|
61
|
+
}
|
|
62
|
+
.vd-radio--checked .vd-radio__text {
|
|
63
|
+
font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
|
|
64
|
+
font-weight: var(--en-single-f-d-s-fontWeight);
|
|
65
|
+
}
|
|
66
|
+
.vd-radio--checked .vd-radio__icon::before {
|
|
67
|
+
border: 0 solid var(--color-check_radio-active);
|
|
68
|
+
border-width: 3px;
|
|
69
|
+
}
|
|
70
|
+
.vd-radio--checked .vd-radio__icon::after {
|
|
71
|
+
position: absolute;
|
|
72
|
+
width: 8px;
|
|
73
|
+
height: 8px;
|
|
74
|
+
left: 50%;
|
|
75
|
+
top: 50%;
|
|
76
|
+
transform: translate(-50%, -50%);
|
|
77
|
+
border-radius: 50%;
|
|
78
|
+
display: table;
|
|
79
|
+
border-top: 0;
|
|
80
|
+
border-left: 0;
|
|
81
|
+
content: " ";
|
|
82
|
+
background-color: var(--color-check_radio-active);
|
|
83
|
+
}
|
|
84
|
+
.vd-radio--disabled {
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
}
|
|
87
|
+
.vd-radio--disabled .vd-radio__text {
|
|
88
|
+
color: var(--color-check_radio-text-disable);
|
|
89
|
+
}
|
|
90
|
+
.vd-radio--disabled .vd-radio__description {
|
|
91
|
+
color: var(--color-check_radio-text_describe-disable);
|
|
92
|
+
}
|
|
93
|
+
.vd-radio--disabled .vd-radio__icon::before {
|
|
94
|
+
border-color: var(--color-check_radio-disable);
|
|
95
|
+
}
|
|
96
|
+
.vd-radio--checked.vd-radio--disabled .vd-radio__icon::before {
|
|
97
|
+
border-color: var(--color-check_radio-active-disable);
|
|
98
|
+
}
|
|
99
|
+
.vd-radio--checked.vd-radio--disabled .vd-radio__icon::after {
|
|
100
|
+
background-color: var(--color-check_radio-active-disable);
|
|
101
|
+
}
|
|
102
|
+
.vd-radio-group {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
gap: calc(var(--spacing-check_radio-group-margin_x)*1px);
|
|
106
|
+
}
|
|
107
|
+
.vd-radio-group-card {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-wrap: wrap;
|
|
110
|
+
flex-direction: row;
|
|
111
|
+
gap: 12px;
|
|
112
|
+
}
|
|
113
|
+
.vd-radio-group-card .vd-radio-button-cell {
|
|
114
|
+
flex: 1;
|
|
115
|
+
}
|
|
116
|
+
.vd-radio-button {
|
|
117
|
+
position: relative;
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
line-height: 1;
|
|
123
|
+
width: 100%;
|
|
124
|
+
}
|
|
125
|
+
.vd-radio-button::after {
|
|
126
|
+
position: absolute;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
content: ' ';
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
top: -50%;
|
|
131
|
+
right: -50%;
|
|
132
|
+
bottom: -50%;
|
|
133
|
+
left: -50%;
|
|
134
|
+
border: 0 solid var(--color-check_radio-radio_border-default);
|
|
135
|
+
-webkit-transform: scale(0.5);
|
|
136
|
+
transform: scale(0.5);
|
|
137
|
+
border-width: 1px;
|
|
138
|
+
}
|
|
139
|
+
.vd-radio-button--large {
|
|
140
|
+
height: calc(var(--height-check_radio-radio_button_l) * 1px);
|
|
141
|
+
}
|
|
142
|
+
.vd-radio-button--large .vd-radio-button-text {
|
|
143
|
+
color: var(--color-check_radio-radio_button_text-default);
|
|
144
|
+
font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
|
|
145
|
+
font-weight: var(--en-single-f-d-r-fontWeight);
|
|
146
|
+
}
|
|
147
|
+
.vd-radio-button--large::after {
|
|
148
|
+
border-radius: calc(var(--radius-check_radio-radio_l) * 2px);
|
|
149
|
+
}
|
|
150
|
+
.vd-radio-button--medium {
|
|
151
|
+
height: calc(var(--height-check_radio-radio_button_m) * 1px);
|
|
152
|
+
}
|
|
153
|
+
.vd-radio-button--medium .vd-radio-button-text {
|
|
154
|
+
color: var(--color-check_radio-radio_button_text-default);
|
|
155
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
156
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
157
|
+
}
|
|
158
|
+
.vd-radio-button--medium::after {
|
|
159
|
+
border-radius: calc(var(--radius-check_radio-m) * 2px);
|
|
160
|
+
}
|
|
161
|
+
.vd-radio-button--small {
|
|
162
|
+
height: calc(var(--height-check_radio-radio_button_s) * 1px);
|
|
163
|
+
}
|
|
164
|
+
.vd-radio-button--small .vd-radio-button-text {
|
|
165
|
+
color: var(--color-check_radio-radio_button_text-default);
|
|
166
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
167
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
168
|
+
}
|
|
169
|
+
.vd-radio-button--small::after {
|
|
170
|
+
border-radius: calc(var(--radius-check_radio-s) * 2px);
|
|
171
|
+
}
|
|
172
|
+
.vd-radio-button--checked {
|
|
173
|
+
background-color: var(--color-check_radio-radio_button_bg-active);
|
|
174
|
+
}
|
|
175
|
+
.vd-radio-button--checked::after {
|
|
176
|
+
border-color: var(--color-check_radio-radio_border-active);
|
|
177
|
+
border-width: 2px;
|
|
178
|
+
}
|
|
179
|
+
.vd-radio-button--checked .vd-radio-button-text {
|
|
180
|
+
color: var(--color-check_radio-radio_button_text-active);
|
|
181
|
+
}
|
|
182
|
+
.vd-radio-button--checked.vd-radio-button--large .vd-radio-button-text {
|
|
183
|
+
font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
|
|
184
|
+
font-weight: var(--en-single-f-d-s-fontWeight);
|
|
185
|
+
}
|
|
186
|
+
.vd-radio-button--checked.vd-radio-button--medium .vd-radio-button-text {
|
|
187
|
+
font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
|
|
188
|
+
font-weight: var(--en-single-f-c-s-fontWeight);
|
|
189
|
+
}
|
|
190
|
+
.vd-radio-button--checked.vd-radio-button--small .vd-radio-button-text {
|
|
191
|
+
font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
|
|
192
|
+
font-weight: var(--en-single-f-c-s-fontWeight);
|
|
193
|
+
}
|
|
194
|
+
.vd-radio-button--disabled {
|
|
195
|
+
cursor: not-allowed;
|
|
196
|
+
}
|
|
197
|
+
.vd-radio-button--disabled .vd-radio-button-text {
|
|
198
|
+
color: var(--color-check_radio-radio_button_text-disable);
|
|
199
|
+
}
|
|
200
|
+
.vd-radio-group {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
gap: calc(var(--spacing-check_radio-group-margin_x)*1px);
|
|
204
|
+
}
|
|
205
|
+
.vd-radio-group__card {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: row;
|
|
208
|
+
flex-wrap: wrap;
|
|
209
|
+
gap: 12px;
|
|
210
|
+
}
|
|
211
|
+
.vd-radio-group .vd-radio-button {
|
|
212
|
+
flex: 1;
|
|
213
|
+
}
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
width: calc(var(--icon-check_radio-sizing) * 1px);
|
|
20
20
|
height: calc(var(--icon-check_radio-sizing) * 1px);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
&__label{
|
|
24
|
+
flex: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
&__text {
|
|
23
28
|
color: var(--color-check_radio-text-default);
|
|
24
29
|
font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
<div class="vd-result">
|
|
3
3
|
<div class="vd-result-img" v-if="currentImg"><img :src="currentImg" alt="img"></div>
|
|
4
4
|
<div class="vd-result-title" v-if="title">{{ title }}</div>
|
|
5
|
-
<
|
|
5
|
+
<div class="vd-result-txt" v-if="text">{{ text }}</div>
|
|
6
6
|
<div class="vd-result-footer">
|
|
7
7
|
<slot name="btnp"></slot>
|
|
8
|
-
|
|
9
8
|
<div class="vd-result-footer-btnx" v-if="$slots.btnt">
|
|
10
9
|
<slot name="btnt"></slot>
|
|
11
10
|
</div>
|
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="vd-selector" :class="wrapClasses" :tabindex="disabled ? -1 : 0"
|
|
3
|
-
@click.stop="handlerClick">
|
|
4
|
-
<div class="vd-selector__inner">
|
|
2
|
+
<div v-clickoutside="close" class="vd-selector" :class="wrapClasses" :tabindex="disabled ? -1 : 0">
|
|
3
|
+
<div class="vd-selector__inner" @click.stop="handlerClick">
|
|
5
4
|
<div :contenteditable="contenteditable" class="vd-selector__left">
|
|
6
5
|
<vd-icon v-if="icon" :name="icon" svg :class="iconClasses"></vd-icon>
|
|
7
6
|
<div :class="titleClasses">
|
|
8
|
-
<slot
|
|
9
|
-
|
|
7
|
+
<slot name="content">
|
|
8
|
+
{{ content }}
|
|
9
|
+
</slot>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
<vd-icon v-if="arrow" :name="arrow" :class="arrowClasses"></vd-icon>
|
|
13
13
|
</div>
|
|
14
|
-
<
|
|
14
|
+
<div class="vd-selector--slot">
|
|
15
|
+
<slot name="dropdown"></slot>
|
|
16
|
+
</div>
|
|
15
17
|
</div>
|
|
16
18
|
</template>
|
|
17
19
|
|
|
18
20
|
<script>
|
|
21
|
+
import clickoutside from "../mixins/clickoutside.js";
|
|
19
22
|
const prefixCls = 'vd-selector';
|
|
23
|
+
|
|
20
24
|
export default {
|
|
21
|
-
name:
|
|
22
|
-
|
|
25
|
+
name: 'vd-selector',
|
|
26
|
+
directives: {
|
|
27
|
+
clickoutside
|
|
28
|
+
},
|
|
23
29
|
props: {
|
|
24
30
|
icon: {
|
|
25
31
|
type: String,
|
|
26
32
|
default: ''
|
|
27
33
|
},
|
|
28
34
|
arrow: {
|
|
29
|
-
type:
|
|
35
|
+
type: String,
|
|
30
36
|
default: 'icon_btn_moredown'
|
|
31
37
|
},
|
|
32
38
|
type: {
|
|
33
39
|
type: String,
|
|
34
|
-
default: ''
|
|
40
|
+
default: '',
|
|
41
|
+
validator: value => ['', 'form'].includes(value)
|
|
35
42
|
},
|
|
36
43
|
size: {
|
|
37
44
|
type: String,
|
|
@@ -39,7 +46,7 @@ export default {
|
|
|
39
46
|
validator: value => ['s', 'm', 'l', 'xl'].includes(value)
|
|
40
47
|
},
|
|
41
48
|
content: {
|
|
42
|
-
type:
|
|
49
|
+
type: String,
|
|
43
50
|
default: ''
|
|
44
51
|
},
|
|
45
52
|
disabled: {
|
|
@@ -57,64 +64,90 @@ export default {
|
|
|
57
64
|
value: {
|
|
58
65
|
type: Boolean,
|
|
59
66
|
default: false
|
|
67
|
+
},
|
|
68
|
+
name: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ''
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
value(val) {
|
|
75
|
+
this.showMenu = val;
|
|
60
76
|
}
|
|
61
77
|
},
|
|
62
78
|
data() {
|
|
63
79
|
return {
|
|
64
|
-
showMenu: this.value
|
|
65
|
-
}
|
|
80
|
+
showMenu: this.value
|
|
81
|
+
}
|
|
66
82
|
},
|
|
67
83
|
computed: {
|
|
68
|
-
|
|
69
|
-
return !this.$slots.content;
|
|
70
|
-
},
|
|
84
|
+
// 计算外层容器的样式类
|
|
71
85
|
wrapClasses() {
|
|
72
86
|
return {
|
|
73
87
|
[`${prefixCls}-${this.type}`]: this.type,
|
|
74
88
|
[`${prefixCls}-${this.size}`]: this.size,
|
|
75
89
|
[`${prefixCls}--disabled`]: this.disabled,
|
|
76
90
|
[`${prefixCls}--active`]: this.showMenu || this.active,
|
|
77
|
-
}
|
|
91
|
+
};
|
|
78
92
|
},
|
|
93
|
+
// 计算标题的样式类
|
|
79
94
|
titleClasses() {
|
|
80
95
|
return {
|
|
81
96
|
[`${prefixCls}-${this.type}__title`]: this.type,
|
|
82
97
|
[`${prefixCls}-${this.size}__title`]: this.size,
|
|
83
|
-
}
|
|
98
|
+
};
|
|
84
99
|
},
|
|
100
|
+
// 计算图标的样式类
|
|
85
101
|
iconClasses() {
|
|
86
102
|
return {
|
|
87
103
|
[`${prefixCls}-iconfont`]: true,
|
|
88
104
|
[`${prefixCls}-${this.type}__icon`]: this.type,
|
|
89
105
|
[`${prefixCls}-${this.size}__icon`]: this.size,
|
|
90
|
-
}
|
|
106
|
+
};
|
|
91
107
|
},
|
|
108
|
+
// 计算箭头的样式类
|
|
92
109
|
arrowClasses() {
|
|
93
110
|
return {
|
|
94
111
|
[`${prefixCls}-iconfont`]: true,
|
|
95
112
|
[`${prefixCls}-${this.type}__arrow`]: this.type,
|
|
96
113
|
[`${prefixCls}-${this.size}__arrow`]: this.size,
|
|
97
114
|
[`${prefixCls}__arrow--active`]: this.showMenu && this.arrow === 'icon_btn_moredown',
|
|
98
|
-
}
|
|
115
|
+
};
|
|
99
116
|
},
|
|
100
117
|
},
|
|
101
|
-
watch: {
|
|
102
|
-
value(val) {
|
|
103
|
-
this.showMenu = val;
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
118
|
methods: {
|
|
119
|
+
generateClasses(suffix = '', extra = '') {
|
|
120
|
+
return {
|
|
121
|
+
[`${prefixCls}-${this.type}${suffix}`]: this.type,
|
|
122
|
+
[`${prefixCls}-${this.size}${suffix}`]: this.size,
|
|
123
|
+
[`${prefixCls}${extra}`]: extra,
|
|
124
|
+
[`${prefixCls}--disabled`]: this.disabled,
|
|
125
|
+
[`${prefixCls}--active`]: this.showMenu || this.active,
|
|
126
|
+
[`${prefixCls}-${this.size}${suffix}--active`]: this.showMenu && this.arrow,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
107
129
|
close() {
|
|
108
|
-
this.showMenu
|
|
109
|
-
|
|
110
|
-
|
|
130
|
+
if (this.showMenu) {
|
|
131
|
+
// this.showMenu = false;
|
|
132
|
+
// this.$emit('close');
|
|
133
|
+
// 传了下拉菜单才执行
|
|
134
|
+
if (this.$scopedSlots.dropdown) {
|
|
135
|
+
console.log('has dropdown')
|
|
136
|
+
this.$emit('input', false);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
111
139
|
},
|
|
112
140
|
handlerClick() {
|
|
113
141
|
if (this.disabled) return;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this
|
|
142
|
+
console.log('showMenu:1:', this.showMenu);
|
|
143
|
+
// 更新showMenu的值
|
|
144
|
+
this.showMenu = !this.showMenu;
|
|
145
|
+
console.log('showMenu:2:', this.showMenu);
|
|
146
|
+
// 使用$emit来更新v-model绑定的值
|
|
147
|
+
this.$emit('input', this.showMenu);
|
|
148
|
+
this.$emit('click');
|
|
117
149
|
}
|
|
150
|
+
|
|
118
151
|
}
|
|
119
152
|
};
|
|
120
153
|
</script>
|
|
@@ -298,6 +298,12 @@
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
&--slot {
|
|
302
|
+
position: absolute;
|
|
303
|
+
top: 100%;
|
|
304
|
+
display: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
301
307
|
&--active {
|
|
302
308
|
.@{selector-prefix-cls}-xl {
|
|
303
309
|
|
|
@@ -372,6 +378,10 @@
|
|
|
372
378
|
transition: transform .3s;
|
|
373
379
|
}
|
|
374
380
|
}
|
|
381
|
+
|
|
382
|
+
.@{selector-prefix-cls}--slot {
|
|
383
|
+
display: block;
|
|
384
|
+
}
|
|
375
385
|
}
|
|
376
386
|
|
|
377
387
|
&--disabled {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div class="vd-title--right" v-if="guideText || arrow || $slots.right">
|
|
12
12
|
<slot name="right">
|
|
13
13
|
<span v-if="guideText" :class="textRightClasses">{{ guideText }}</span>
|
|
14
|
-
<vd-icon v-if="arrow" class="vd-title-arrow" name="
|
|
14
|
+
<vd-icon v-if="arrow" class="vd-title-arrow" name="icon_btn_next"></vd-icon>
|
|
15
15
|
</slot>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|