提交 0b11182e 编写于 作者: C cloudIC

fix(picker): change params

上级 2ae096e6
...@@ -212,8 +212,10 @@ ...@@ -212,8 +212,10 @@
this.selfTriggered = false; this.selfTriggered = false;
return; return;
} }
this.currentValue = this.getValue(values); if (values.length !== 0) {
this.handleValueChange(); this.currentValue = this.getValue(values);
this.handleValueChange();
}
}, },
fillValues(type, start, end) { fillValues(type, start, end) {
......
...@@ -94,16 +94,6 @@ ...@@ -94,16 +94,6 @@
created() { created() {
this.$on('slotValueChange', this.slotValueChange); this.$on('slotValueChange', this.slotValueChange);
var slots = this.slots || [];
var values = [];
var valueIndexCount = 0;
slots.forEach(slot => {
if (!slot.divider) {
slot.valueIndex = valueIndexCount++;
values[slot.valueIndex] = (slot.values || [])[slot.defaultIndex || 0];
}
});
this.values = values;
this.slotValueChange(); this.slotValueChange();
}, },
...@@ -132,7 +122,7 @@ ...@@ -132,7 +122,7 @@
getSlotValue(index) { getSlotValue(index) {
var slot = this.getSlot(index); var slot = this.getSlot(index);
if (slot) { if (slot) {
return slot.value; return slot.currentValue;
} }
return null; return null;
}, },
...@@ -175,18 +165,14 @@ ...@@ -175,18 +165,14 @@
get() { get() {
var slots = this.slots || []; var slots = this.slots || [];
var values = []; var values = [];
slots.forEach(function(slot) {
if (!slot.divider) values.push(slot.value);
});
return values;
},
set(values) {
var slots = this.slots || [];
var valueIndexCount = 0; var valueIndexCount = 0;
slots.forEach(function(slot) { slots.forEach(slot => {
if (!slot.divider) slot.value = values[valueIndexCount++]; if (!slot.divider) {
slot.valueIndex = valueIndexCount++;
values[slot.valueIndex] = (slot.values || [])[slot.defaultIndex || 0];
}
}); });
return values;
} }
}, },
slotCount() { slotCount() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册