vdesign-ui 0.1.24 → 0.2.0-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 +14 -12
- package/dist/components/button/index.vue +1 -1
- package/dist/components/checkbox/checkbox-group/index.vue +2 -1
- package/dist/components/checkbox/index.vue +19 -20
- package/dist/components/dialog/index.vue +15 -11
- package/dist/components/dropdown/index.vue +43 -31
- 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 +5 -1
- package/dist/components/footnav/footnav-item/index.vue +11 -42
- package/dist/components/footnav/index.vue +13 -27
- package/dist/components/headnav/index.vue +52 -35
- package/dist/components/icon/font/iconfont.css +62 -952
- package/dist/components/icon/font/iconfont.js +1 -1
- package/dist/components/icon/index.vue +26 -18
- package/dist/components/input/index.vue +107 -109
- package/dist/components/input/search/index.vue +18 -22
- package/dist/components/input/stepper/index.vue +32 -26
- package/dist/components/input/style.less +20 -33
- package/dist/components/list/index.vue +57 -69
- package/dist/components/list/style.less +20 -92
- 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 +21 -11
- package/dist/components/loading/style.less +1 -1
- package/dist/components/mixins/clickoutside.js +81 -81
- package/dist/components/pagebreak/index.vue +21 -14
- package/dist/components/radio/index.vue +164 -135
- package/dist/components/radio/radio-group/index.vue +40 -52
- package/dist/components/result/index.vue +1 -2
- package/dist/components/selector/index.vue +49 -31
- package/dist/components/selector/style.less +14 -0
- package/dist/components/step-item/index.vue +2 -2
- package/dist/components/tabs/index.vue +55 -32
- package/dist/components/tabs/tab/index.vue +13 -16
- package/dist/components/tag/index.vue +18 -4
- package/dist/components/tag/style.less +2 -2
- package/dist/components/title/index.vue +11 -8
- package/dist/components/title/style.less +6 -0
- 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 +8 -0
- package/dist/vdesign-ui.common.js +1362 -1170
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +1362 -1170
- 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
|
@@ -1,155 +1,184 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 常规单选框 -->
|
|
2
3
|
<label :class="wrapClasses" v-if="!radioButton">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<span :class="radioClasses">
|
|
5
|
+
<span :class="innerClasses"></span>
|
|
6
|
+
<input
|
|
7
|
+
type="radio"
|
|
8
|
+
:class="inputClasses"
|
|
9
|
+
:disabled="isDisabled"
|
|
10
|
+
:checked="currentValue"
|
|
11
|
+
@change="handleChange"
|
|
12
|
+
>
|
|
13
|
+
</span>
|
|
14
|
+
<!-- 标签内容 -->
|
|
15
|
+
<div class="vd-radio__label" v-if="$slots.default">
|
|
16
|
+
<div class="vd-radio__text">
|
|
17
|
+
<slot></slot>
|
|
12
18
|
</div>
|
|
19
|
+
</div>
|
|
13
20
|
</label>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<label
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
<!-- 按钮样式的单选框 -->
|
|
23
|
+
<label
|
|
24
|
+
class="vd-radio vd-radio-button"
|
|
25
|
+
:class="radioButtonClasses"
|
|
26
|
+
v-else
|
|
27
|
+
>
|
|
28
|
+
<input
|
|
29
|
+
type="radio"
|
|
30
|
+
:class="inputClasses"
|
|
31
|
+
:disabled="isDisabled"
|
|
32
|
+
:checked="currentValue"
|
|
33
|
+
@change="handleChange"
|
|
34
|
+
>
|
|
35
|
+
<span class="vd-radio-button-text">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</span>
|
|
21
38
|
</label>
|
|
22
|
-
</template>
|
|
23
|
-
<script>
|
|
24
|
-
import { findComponentUpward } from './assist';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
</template>
|
|
40
|
+
<script>
|
|
41
|
+
import { findComponentUpward } from './assist';
|
|
42
|
+
|
|
43
|
+
const prefixCls = 'vd-radio';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
28
46
|
name: 'vd-radio',
|
|
29
47
|
props: {
|
|
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
|
-
|
|
48
|
+
// 组件的值,用于 v-model 绑定
|
|
49
|
+
value: {
|
|
50
|
+
type: [String, Number, Boolean],
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
// 是否为按钮样式
|
|
54
|
+
radioButton: Boolean,
|
|
55
|
+
// 是否禁用
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
// 选中时的值
|
|
61
|
+
trueValue: {
|
|
62
|
+
type: [String, Number, Boolean],
|
|
63
|
+
default: true,
|
|
64
|
+
},
|
|
65
|
+
// 未选中时的值
|
|
66
|
+
falseValue: {
|
|
67
|
+
type: [String, Number, Boolean],
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
// 单选框的标识名称,在组内使用
|
|
71
|
+
name: {
|
|
72
|
+
type: [String, Number, Boolean],
|
|
73
|
+
},
|
|
74
|
+
// 类型,用于样式
|
|
75
|
+
type: String,
|
|
57
76
|
},
|
|
58
77
|
data() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
return {
|
|
79
|
+
// 当前是否选中
|
|
80
|
+
currentValue: this.value === this.trueValue,
|
|
81
|
+
// 是否属于单选框组
|
|
82
|
+
isGroup: false,
|
|
83
|
+
// 父级单选框组的引用
|
|
84
|
+
parentGroup: null,
|
|
85
|
+
};
|
|
67
86
|
},
|
|
68
87
|
computed: {
|
|
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
|
-
|
|
88
|
+
// 计算禁用状态,优先级:自身 > 组
|
|
89
|
+
isDisabled() {
|
|
90
|
+
return this.disabled || (this.isGroup && this.parentGroup.disabled);
|
|
91
|
+
},
|
|
92
|
+
// 包裹类名
|
|
93
|
+
wrapClasses() {
|
|
94
|
+
return [
|
|
95
|
+
`${prefixCls}`,
|
|
96
|
+
{
|
|
97
|
+
[`${prefixCls}--checked`]: this.currentValue,
|
|
98
|
+
[`${prefixCls}--disabled`]: this.isDisabled,
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
},
|
|
102
|
+
// 单选框的类名
|
|
103
|
+
radioClasses() {
|
|
104
|
+
return [`${prefixCls}__input`];
|
|
105
|
+
},
|
|
106
|
+
// 图标的类名
|
|
107
|
+
innerClasses() {
|
|
108
|
+
return [`${prefixCls}__icon`];
|
|
109
|
+
},
|
|
110
|
+
// 输入框的类名
|
|
111
|
+
inputClasses() {
|
|
112
|
+
return `${prefixCls}__original`;
|
|
113
|
+
},
|
|
114
|
+
// 按钮样式的类名
|
|
115
|
+
radioButtonClasses() {
|
|
116
|
+
return [
|
|
117
|
+
{
|
|
118
|
+
[`${prefixCls}-button--checked`]: this.currentValue,
|
|
119
|
+
[`${prefixCls}-button--${this.type}`]: this.type,
|
|
120
|
+
[`${prefixCls}-button--disabled`]: this.isDisabled,
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
},
|
|
101
124
|
},
|
|
102
125
|
mounted() {
|
|
103
|
-
|
|
104
|
-
|
|
126
|
+
// 查找父级 vd-radio-group 组件
|
|
127
|
+
this.parentGroup = findComponentUpward(this, 'vd-radio-group');
|
|
128
|
+
this.isGroup = !!this.parentGroup;
|
|
129
|
+
|
|
130
|
+
if (this.isGroup) {
|
|
131
|
+
// 如果在组内,注册到组中
|
|
132
|
+
this.parentGroup.updateValue();
|
|
133
|
+
} else {
|
|
134
|
+
// 如果不在组内,更新自身的选中状态
|
|
135
|
+
this.updateValue();
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
methods: {
|
|
139
|
+
// 处理 change 事件
|
|
140
|
+
handleChange(event) {
|
|
141
|
+
if (this.isDisabled) {
|
|
142
|
+
return;
|
|
105
143
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
|
|
145
|
+
const checked = event.target.checked;
|
|
146
|
+
this.currentValue = checked;
|
|
147
|
+
const value = checked ? this.trueValue : this.falseValue;
|
|
148
|
+
this.$emit('input', value);
|
|
149
|
+
|
|
150
|
+
if (this.isGroup) {
|
|
151
|
+
// 如果在组内,通知组更新
|
|
152
|
+
this.parentGroup.change(this.name);
|
|
109
153
|
} else {
|
|
110
|
-
|
|
154
|
+
// 否则,触发自身的 change 事件
|
|
155
|
+
this.$emit('change', value);
|
|
111
156
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.$emit('input', value);
|
|
124
|
-
|
|
125
|
-
if (this.group) {
|
|
126
|
-
if (this.name !== undefined) {
|
|
127
|
-
this.parent.change({
|
|
128
|
-
value: this.name,
|
|
129
|
-
checked: this.value
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
} else {
|
|
133
|
-
this.$emit('change', value);
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
updateValue() {
|
|
137
|
-
this.currentValue = this.value === this.trueValue;
|
|
138
|
-
},
|
|
139
|
-
|
|
157
|
+
},
|
|
158
|
+
// 更新 currentValue
|
|
159
|
+
updateValue() {
|
|
160
|
+
if (this.isGroup) {
|
|
161
|
+
// 组内,通过比较组的值和自身的 name 来确定是否选中
|
|
162
|
+
this.currentValue = this.parentGroup.value === this.name;
|
|
163
|
+
} else {
|
|
164
|
+
// 组外,通过比较 value 和 trueValue
|
|
165
|
+
this.currentValue = this.value === this.trueValue;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
140
168
|
},
|
|
141
169
|
watch: {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
170
|
+
// 监听 value 的变化
|
|
171
|
+
value() {
|
|
172
|
+
this.updateValue();
|
|
173
|
+
},
|
|
174
|
+
// 如果在组内,监听组的 value 变化
|
|
175
|
+
'parentGroup.value'() {
|
|
176
|
+
this.updateValue();
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
181
|
+
|
|
153
182
|
<style lang="less">
|
|
154
|
-
@import
|
|
183
|
+
@import "./style.less";
|
|
155
184
|
</style>
|
|
@@ -9,62 +9,50 @@ import { findComponentsDownward } from '../assist';
|
|
|
9
9
|
const prefixCls = 'vd-radio-group';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: ''
|
|
21
|
-
}
|
|
12
|
+
name: 'vd-radio-group',
|
|
13
|
+
props: {
|
|
14
|
+
// 绑定的值,用于 v-model
|
|
15
|
+
value: {
|
|
16
|
+
type: [String, Number, Boolean],
|
|
17
|
+
default: '',
|
|
22
18
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
// 类型,用于样式
|
|
20
|
+
type: String,
|
|
21
|
+
// 是否禁用组内所有单选框
|
|
22
|
+
disabled: Boolean
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
// 组容器的类名
|
|
26
|
+
classes() {
|
|
27
|
+
return [
|
|
28
|
+
`${prefixCls}`,
|
|
29
|
+
{
|
|
30
|
+
[`${prefixCls}__${this.type}`]: this.type,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
28
33
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
// 更新子单选框的状态
|
|
37
|
+
updateValue() {
|
|
38
|
+
const children = findComponentsDownward(this, 'vd-radio');
|
|
39
|
+
if (children.length) {
|
|
40
|
+
children.forEach((child) => {
|
|
41
|
+
child.updateValue();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
38
44
|
},
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
// 处理子单选框的变化
|
|
46
|
+
change(name) {
|
|
47
|
+
this.$emit('input', name);
|
|
48
|
+
this.$emit('change', name);
|
|
41
49
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
child.currentValue = this.currentValue === child.name;
|
|
48
|
-
child.group = true;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
change(data) {
|
|
53
|
-
this.currentValue = data.value;
|
|
54
|
-
this.updateValue();
|
|
55
|
-
this.$emit('input', data.value);
|
|
56
|
-
this.$emit('change', data.value);
|
|
57
|
-
}
|
|
50
|
+
},
|
|
51
|
+
watch: {
|
|
52
|
+
// 监听 value 的变化,更新子组件
|
|
53
|
+
value() {
|
|
54
|
+
this.updateValue();
|
|
58
55
|
},
|
|
59
|
-
|
|
60
|
-
value() {
|
|
61
|
-
if (this.currentValue !== this.value) {
|
|
62
|
-
this.currentValue = this.value;
|
|
63
|
-
this.$nextTick(() => {
|
|
64
|
-
this.updateValue();
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
56
|
+
},
|
|
69
57
|
};
|
|
70
58
|
</script>
|
|
@@ -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,7 +1,6 @@
|
|
|
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">
|
|
@@ -12,73 +11,73 @@
|
|
|
12
11
|
</div>
|
|
13
12
|
<vd-icon v-if="arrow" :name="arrow" :class="arrowClasses"></vd-icon>
|
|
14
13
|
</div>
|
|
15
|
-
<
|
|
14
|
+
<div class="vd-selector--slot">
|
|
15
|
+
<slot name="dropdown"></slot>
|
|
16
|
+
</div>
|
|
16
17
|
</div>
|
|
17
18
|
</template>
|
|
18
19
|
|
|
19
20
|
<script>
|
|
21
|
+
import clickoutside from "../mixins/clickoutside.js";
|
|
20
22
|
const prefixCls = 'vd-selector';
|
|
21
23
|
|
|
22
24
|
export default {
|
|
23
25
|
name: 'vd-selector',
|
|
26
|
+
directives: {
|
|
27
|
+
clickoutside
|
|
28
|
+
},
|
|
24
29
|
props: {
|
|
25
|
-
// 图标名称
|
|
26
30
|
icon: {
|
|
27
31
|
type: String,
|
|
28
32
|
default: ''
|
|
29
33
|
},
|
|
30
|
-
// 箭头图标名称或布尔值(是否显示箭头)
|
|
31
34
|
arrow: {
|
|
32
|
-
type:
|
|
35
|
+
type: String,
|
|
33
36
|
default: 'icon_btn_moredown'
|
|
34
37
|
},
|
|
35
|
-
// 组件类型(用于自定义样式)
|
|
36
38
|
type: {
|
|
37
39
|
type: String,
|
|
38
|
-
default: ''
|
|
40
|
+
default: '',
|
|
41
|
+
validator: value => ['', 'form'].includes(value)
|
|
39
42
|
},
|
|
40
|
-
// 组件尺寸
|
|
41
43
|
size: {
|
|
42
44
|
type: String,
|
|
43
45
|
default: 'm',
|
|
44
46
|
validator: value => ['s', 'm', 'l', 'xl'].includes(value)
|
|
45
47
|
},
|
|
46
|
-
// 组件内容
|
|
47
48
|
content: {
|
|
48
|
-
type:
|
|
49
|
+
type: String,
|
|
49
50
|
default: ''
|
|
50
51
|
},
|
|
51
|
-
// 是否禁用组件
|
|
52
52
|
disabled: {
|
|
53
53
|
type: Boolean,
|
|
54
54
|
default: false
|
|
55
55
|
},
|
|
56
|
-
// 是否激活组件
|
|
57
56
|
active: {
|
|
58
57
|
type: Boolean,
|
|
59
58
|
default: false
|
|
60
59
|
},
|
|
61
|
-
// 是否允许编辑内容
|
|
62
60
|
contenteditable: {
|
|
63
61
|
type: Boolean,
|
|
64
62
|
default: false
|
|
65
63
|
},
|
|
66
|
-
// 是否显示子菜单
|
|
67
64
|
value: {
|
|
68
65
|
type: Boolean,
|
|
69
66
|
default: false
|
|
67
|
+
},
|
|
68
|
+
name: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ''
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
value(val) {
|
|
75
|
+
this.showMenu = val;
|
|
70
76
|
}
|
|
71
77
|
},
|
|
72
78
|
data() {
|
|
73
79
|
return {
|
|
74
|
-
|
|
75
|
-
showMenu: false
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
watch: {
|
|
79
|
-
// 监听 value 属性变化,同步更新 showMenu
|
|
80
|
-
value(newVal) {
|
|
81
|
-
this.showMenu = newVal;
|
|
80
|
+
showMenu: this.value
|
|
82
81
|
}
|
|
83
82
|
},
|
|
84
83
|
computed: {
|
|
@@ -117,19 +116,38 @@ export default {
|
|
|
117
116
|
},
|
|
118
117
|
},
|
|
119
118
|
methods: {
|
|
120
|
-
|
|
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
|
+
},
|
|
121
129
|
close() {
|
|
122
|
-
this.showMenu
|
|
123
|
-
|
|
124
|
-
|
|
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
|
+
}
|
|
125
139
|
},
|
|
126
|
-
// 处理点击事件
|
|
127
140
|
handlerClick() {
|
|
128
141
|
if (this.disabled) return;
|
|
142
|
+
console.log('showMenu:1:', this.showMenu);
|
|
143
|
+
// 更新showMenu的值
|
|
129
144
|
this.showMenu = !this.showMenu;
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
console.log('showMenu:2:', this.showMenu);
|
|
146
|
+
// 使用$emit来更新v-model绑定的值
|
|
147
|
+
this.$emit('input', this.showMenu);
|
|
148
|
+
this.$emit('click');
|
|
132
149
|
}
|
|
150
|
+
|
|
133
151
|
}
|
|
134
152
|
};
|
|
135
153
|
</script>
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&__icon {
|
|
61
|
+
display: flex;
|
|
61
62
|
font-size: calc(var(--icon-selector-xl) * 1px);
|
|
62
63
|
margin-inline-end: calc(var(--spacing-selector-xl-margin_y) * 1px);
|
|
63
64
|
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
&__icon {
|
|
112
|
+
display: flex;
|
|
111
113
|
font-size: calc(var(--icon-selector-l) * 1px);
|
|
112
114
|
margin-inline-end: calc(var(--spacing-selector-l-margin_y) * 1px);
|
|
113
115
|
|
|
@@ -157,6 +159,7 @@
|
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
&__icon {
|
|
162
|
+
display: flex;
|
|
160
163
|
font-size: calc(var(--icon-selector-m) * 1px);
|
|
161
164
|
margin-inline-end: calc(var(--spacing-selector-m-margin_y) * 1px);
|
|
162
165
|
|
|
@@ -205,6 +208,7 @@
|
|
|
205
208
|
}
|
|
206
209
|
|
|
207
210
|
&__icon {
|
|
211
|
+
display: flex;
|
|
208
212
|
font-size: calc(var(--icon-selector-s) * 1px);
|
|
209
213
|
margin-inline-end: calc(var(--spacing-selector-s-margin_y) * 1px);
|
|
210
214
|
|
|
@@ -298,6 +302,12 @@
|
|
|
298
302
|
}
|
|
299
303
|
}
|
|
300
304
|
|
|
305
|
+
&--slot {
|
|
306
|
+
position: absolute;
|
|
307
|
+
top: 100%;
|
|
308
|
+
display: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
301
311
|
&--active {
|
|
302
312
|
.@{selector-prefix-cls}-xl {
|
|
303
313
|
|
|
@@ -372,6 +382,10 @@
|
|
|
372
382
|
transition: transform .3s;
|
|
373
383
|
}
|
|
374
384
|
}
|
|
385
|
+
|
|
386
|
+
.@{selector-prefix-cls}--slot {
|
|
387
|
+
display: block;
|
|
388
|
+
}
|
|
375
389
|
}
|
|
376
390
|
|
|
377
391
|
&--disabled {
|
|
@@ -70,9 +70,9 @@ export default {
|
|
|
70
70
|
},
|
|
71
71
|
iconName() {
|
|
72
72
|
if (this.state === 'afoot') {
|
|
73
|
-
return this.currentTheme === 'dark' ? '
|
|
73
|
+
return this.currentTheme === 'dark' ? 'icon_show_steping1_svg' : 'icon_show_steping_svg'
|
|
74
74
|
} else if (this.state === 'warning') {
|
|
75
|
-
return this.currentTheme === 'dark' ? '
|
|
75
|
+
return this.currentTheme === 'dark' ? 'icon_show_stepwrong1_svg' : 'icon_show_stepwrong_svg'
|
|
76
76
|
}
|
|
77
77
|
return ''
|
|
78
78
|
}
|