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

fix(picker): change params

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