vdesign-ui 0.2.19 → 0.3.0
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/README.md +58 -58
- package/dist/components/actionbar/index.js +8 -8
- package/dist/components/actionbar/index.vue +39 -39
- package/dist/components/actionbar/style.less +44 -44
- package/dist/components/actionbar-cell/index.js +7 -7
- package/dist/components/actionbar-cell/index.vue +42 -42
- package/dist/components/actions/index.js +6 -6
- package/dist/components/actions/index.vue +77 -77
- package/dist/components/actions/style.less +109 -109
- package/dist/components/actions-cell/index.js +6 -6
- package/dist/components/actions-cell/index.vue +94 -94
- package/dist/components/actions-cell/style.less +38 -38
- package/dist/components/activityviews/index.js +8 -8
- package/dist/components/activityviews/index.vue +192 -192
- package/dist/components/activityviews/style.less +161 -161
- package/dist/components/badge/index.js +8 -8
- package/dist/components/badge/index.vue +49 -49
- package/dist/components/badge/style.less +54 -54
- package/dist/components/button/index.js +8 -8
- package/dist/components/button/index.vue +93 -93
- package/dist/components/button/style.less +558 -558
- package/dist/components/calendar/index-element.vue +84 -84
- package/dist/components/calendar/index.js +7 -7
- package/dist/components/calendar/index.vue +53 -53
- package/dist/components/calendar/style.less +138 -138
- package/dist/components/checkbox/index.js +8 -8
- package/dist/components/checkbox/index.vue +161 -161
- package/dist/components/checkbox/style.less +288 -288
- package/dist/components/checkbox-group/index.js +7 -7
- package/dist/components/checkbox-group/index.vue +73 -73
- package/dist/components/common/state/index.vue +33 -33
- package/dist/components/common/state/style.less +47 -47
- package/dist/components/data-list/index.js +10 -10
- package/dist/components/data-list/index.vue +19 -19
- package/dist/components/data-list/style.less +623 -623
- package/dist/components/datetime-picker/index.js +7 -7
- package/dist/components/datetime-picker/index.vue +39 -39
- package/dist/components/datetime-picker/style.less +23 -23
- package/dist/components/dialog/index.js +8 -8
- package/dist/components/dialog/index.vue +164 -164
- package/dist/components/dialog/overlay-manager.js +18 -18
- package/dist/components/dialog/style.less +138 -138
- package/dist/components/divider/index.js +8 -8
- package/dist/components/divider/index.vue +54 -54
- package/dist/components/divider/style.less +92 -92
- package/dist/components/dropdown/index.js +8 -8
- package/dist/components/dropdown/index.vue +218 -218
- package/dist/components/dropdown/style.less +432 -432
- package/dist/components/empty/index.js +8 -8
- package/dist/components/empty/index.vue +138 -138
- package/dist/components/empty/style.less +60 -60
- package/dist/components/footer/index.js +6 -6
- package/dist/components/footer/index.vue +33 -33
- package/dist/components/footer/style.less +20 -20
- package/dist/components/footnav/index.js +6 -6
- package/dist/components/footnav/index.vue +93 -93
- package/dist/components/footnav/style.less +22 -22
- package/dist/components/footnav-item/index.js +6 -6
- package/dist/components/footnav-item/index.vue +50 -50
- package/dist/components/footnav-item/style.less +39 -39
- package/dist/components/form/index.js +6 -6
- package/dist/components/form/index.vue +14 -14
- package/dist/components/headnav/index.js +6 -6
- package/dist/components/headnav/index.vue +185 -185
- package/dist/components/headnav/style.less +231 -231
- package/dist/components/icon/font/iconfont.css +163 -163
- package/dist/components/icon/font/iconfont.js +5 -5
- package/dist/components/icon/index.js +9 -9
- package/dist/components/icon/index.vue +96 -96
- package/dist/components/icon/style.less +44 -44
- package/dist/components/input/calcTextareaHeight.js +162 -162
- package/dist/components/input/index.js +8 -8
- package/dist/components/input/index.vue +345 -345
- package/dist/components/input/style.less +471 -471
- package/dist/components/list/index.js +8 -8
- package/dist/components/list/index.vue +152 -152
- package/dist/components/list/style.less +213 -213
- package/dist/components/loading/index.js +6 -6
- package/dist/components/loading/index.vue +68 -68
- package/dist/components/loading/style.less +53 -53
- package/dist/components/mixins/clickoutside.js +81 -81
- package/dist/components/mixins/dom.js +41 -41
- package/dist/components/mixins/languageMixin.js +43 -41
- package/dist/components/mixins/outlineConfigPlugin.js +45 -45
- package/dist/components/mixins/router-link.js +22 -22
- package/dist/components/mixins/themeMixin.js +43 -43
- package/dist/components/noticebar/index.js +8 -8
- package/dist/components/noticebar/index.vue +258 -258
- package/dist/components/noticebar/style.less +333 -328
- package/dist/components/overlay/index.js +8 -8
- package/dist/components/overlay/index.vue +184 -184
- package/dist/components/overlay/style.less +24 -24
- package/dist/components/pagebreak/index.js +6 -6
- package/dist/components/pagebreak/index.vue +67 -67
- package/dist/components/pagebreak/style.less +41 -41
- package/dist/components/password/index.js +8 -8
- package/dist/components/password/index.vue +64 -64
- package/dist/components/popover/index.js +8 -8
- package/dist/components/popover/index.vue +100 -100
- package/dist/components/popover/style.less +346 -346
- package/dist/components/popover/vue-popover.vue +314 -314
- package/dist/components/popup/index.js +7 -7
- package/dist/components/popup/index.vue +165 -165
- package/dist/components/popup/style.less +78 -78
- package/dist/components/radio/index.js +8 -8
- package/dist/components/radio/index.vue +184 -184
- package/dist/components/radio/style.less +300 -300
- package/dist/components/radio-group/index.js +7 -7
- package/dist/components/radio-group/index.vue +62 -62
- package/dist/components/result/index.js +8 -8
- package/dist/components/result/index.vue +73 -73
- package/dist/components/result/style.less +43 -43
- package/dist/components/search/index.js +8 -8
- package/dist/components/search/index.vue +70 -70
- package/dist/components/selector/index.js +8 -8
- package/dist/components/selector/index.vue +161 -161
- package/dist/components/selector/style.less +484 -484
- package/dist/components/skeleton/index.js +6 -6
- package/dist/components/skeleton/index.vue +207 -207
- package/dist/components/skeleton/style.less +196 -196
- package/dist/components/slider/draggable.js +49 -49
- package/dist/components/slider/index.js +6 -6
- package/dist/components/slider/index.vue +167 -167
- package/dist/components/slider/style.less +99 -99
- package/dist/components/slider/utils.js +59 -59
- package/dist/components/step/index.js +7 -7
- package/dist/components/step/index.vue +48 -48
- package/dist/components/step/style.less +66 -66
- package/dist/components/step-item/index.js +7 -7
- package/dist/components/step-item/index.vue +126 -126
- package/dist/components/step-item/style.less +399 -399
- package/dist/components/stepper/index.js +8 -8
- package/dist/components/stepper/index.vue +150 -150
- package/dist/components/style/index.vue +42 -42
- package/dist/components/switch/index.js +8 -8
- package/dist/components/switch/index.vue +72 -72
- package/dist/components/switch/style.less +56 -56
- package/dist/components/tab/index.js +7 -7
- package/dist/components/tab/index.vue +97 -97
- package/dist/components/tabs/index.js +8 -8
- package/dist/components/tabs/index.vue +356 -348
- package/dist/components/tabs/style.less +504 -493
- package/dist/components/tag/index.js +6 -6
- package/dist/components/tag/index.vue +64 -64
- package/dist/components/tag/style.less +210 -210
- package/dist/components/title/index.js +8 -8
- package/dist/components/title/index.vue +99 -99
- package/dist/components/title/style.less +187 -187
- package/dist/components/toast/index.js +139 -97
- package/dist/components/toast/index.vue +50 -49
- package/dist/components/toast/style.less +58 -57
- package/dist/components/transition/index.js +8 -8
- package/dist/components/transition/index.vue +13 -13
- package/dist/components/transition/style.less +208 -208
- package/dist/components/upload/index.js +6 -6
- package/dist/components/upload/index.vue +106 -106
- package/dist/components/upload/style.less +147 -147
- package/dist/components/utils/assist.js +34 -34
- package/dist/components/utils/env.js +21 -21
- package/dist/locale/ar.js +97 -97
- package/dist/locale/en.js +97 -97
- package/dist/locale/zh.js +97 -97
- package/dist/token.css +9 -9
- package/dist/vdesign-ui.common.js +212 -161
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +212 -161
- package/dist/vdesign-ui.umd.min.js +2 -2
- package/package.json +113 -113
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 常规单选框 -->
|
|
3
|
-
<label :class="wrapClasses" v-if="!radioButton">
|
|
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>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</label>
|
|
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>
|
|
38
|
-
</label>
|
|
39
|
-
</template>
|
|
40
|
-
<script>
|
|
41
|
-
import { findComponentUpward } from "../utils/assist";
|
|
42
|
-
|
|
43
|
-
const prefixCls = 'vd-radio';
|
|
44
|
-
|
|
45
|
-
export default {
|
|
46
|
-
name: 'vd-radio',
|
|
47
|
-
props: {
|
|
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,
|
|
76
|
-
},
|
|
77
|
-
data() {
|
|
78
|
-
return {
|
|
79
|
-
// 当前是否选中
|
|
80
|
-
currentValue: this.value === this.trueValue,
|
|
81
|
-
// 是否属于单选框组
|
|
82
|
-
isGroup: false,
|
|
83
|
-
// 父级单选框组的引用
|
|
84
|
-
parentGroup: null,
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
computed: {
|
|
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
|
-
},
|
|
124
|
-
},
|
|
125
|
-
mounted() {
|
|
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;
|
|
143
|
-
}
|
|
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);
|
|
153
|
-
} else {
|
|
154
|
-
// 否则,触发自身的 change 事件
|
|
155
|
-
this.$emit('change', value);
|
|
156
|
-
}
|
|
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
|
-
},
|
|
168
|
-
},
|
|
169
|
-
watch: {
|
|
170
|
-
// 监听 value 的变化
|
|
171
|
-
value() {
|
|
172
|
-
this.updateValue();
|
|
173
|
-
},
|
|
174
|
-
// 如果在组内,监听组的 value 变化
|
|
175
|
-
'parentGroup.value'() {
|
|
176
|
-
this.updateValue();
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
</script>
|
|
181
|
-
|
|
182
|
-
<style lang="less">
|
|
183
|
-
@import "./style.less";
|
|
184
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 常规单选框 -->
|
|
3
|
+
<label :class="wrapClasses" v-if="!radioButton">
|
|
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>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</label>
|
|
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>
|
|
38
|
+
</label>
|
|
39
|
+
</template>
|
|
40
|
+
<script>
|
|
41
|
+
import { findComponentUpward } from "../utils/assist";
|
|
42
|
+
|
|
43
|
+
const prefixCls = 'vd-radio';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'vd-radio',
|
|
47
|
+
props: {
|
|
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,
|
|
76
|
+
},
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
// 当前是否选中
|
|
80
|
+
currentValue: this.value === this.trueValue,
|
|
81
|
+
// 是否属于单选框组
|
|
82
|
+
isGroup: false,
|
|
83
|
+
// 父级单选框组的引用
|
|
84
|
+
parentGroup: null,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
computed: {
|
|
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
|
+
},
|
|
124
|
+
},
|
|
125
|
+
mounted() {
|
|
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;
|
|
143
|
+
}
|
|
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);
|
|
153
|
+
} else {
|
|
154
|
+
// 否则,触发自身的 change 事件
|
|
155
|
+
this.$emit('change', value);
|
|
156
|
+
}
|
|
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
|
+
},
|
|
168
|
+
},
|
|
169
|
+
watch: {
|
|
170
|
+
// 监听 value 的变化
|
|
171
|
+
value() {
|
|
172
|
+
this.updateValue();
|
|
173
|
+
},
|
|
174
|
+
// 如果在组内,监听组的 value 变化
|
|
175
|
+
'parentGroup.value'() {
|
|
176
|
+
this.updateValue();
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
181
|
+
|
|
182
|
+
<style lang="less">
|
|
183
|
+
@import "./style.less";
|
|
184
|
+
</style>
|