doway-coms 2.2.30 → 2.2.32
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/package.json
CHANGED
|
@@ -244,6 +244,12 @@ export default {
|
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
246
|
props: {
|
|
247
|
+
dataSource: {
|
|
248
|
+
type: Array,
|
|
249
|
+
default: function() {
|
|
250
|
+
return []
|
|
251
|
+
}
|
|
252
|
+
},
|
|
247
253
|
labelWidth: {
|
|
248
254
|
type: Number,
|
|
249
255
|
default: function () {
|
|
@@ -422,7 +428,14 @@ export default {
|
|
|
422
428
|
currentValue: {
|
|
423
429
|
// 动态计算currentValue的值
|
|
424
430
|
get: function () {
|
|
425
|
-
return this.value // 将props中的value赋值给currentValue
|
|
431
|
+
// return this.value // 将props中的value赋值给currentValue
|
|
432
|
+
for (let i = 0; i < this.dataSource.length; i++) {
|
|
433
|
+
const element = this.dataSource[i];
|
|
434
|
+
if (this.value === element.value) {
|
|
435
|
+
return element.caption
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return this.value
|
|
426
439
|
},
|
|
427
440
|
set: function (val) {
|
|
428
441
|
this.$emit('input', val) // 通过$emit触发父组件
|