Skip to content

Commit 166a2cf

Browse files
author
cloudIC
committed
fix: picker change params
1 parent 121c301 commit 166a2cf

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/picker/src/picker-slot.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@
421421
422422
mounted() {
423423
this.ready = true;
424-
this.$emit('input', this.currentValue);
425424
426425
if (!this.divider) {
427426
this.initEvents();

packages/picker/src/picker.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@
9595
created() {
9696
this.$on('slotValueChange', this.slotValueChange);
9797
var slots = this.slots || [];
98-
this.values = [];
99-
var values = this.values;
98+
var values = [];
10099
var valueIndexCount = 0;
101100
slots.forEach(slot => {
102101
if (!slot.divider) {
103102
slot.valueIndex = valueIndexCount++;
104103
values[slot.valueIndex] = (slot.values || [])[slot.defaultIndex || 0];
105-
this.slotValueChange();
106104
}
107105
});
106+
this.values = values;
107+
this.slotValueChange();
108108
},
109109
110110
methods: {
@@ -185,10 +185,7 @@
185185
var slots = this.slots || [];
186186
var valueIndexCount = 0;
187187
slots.forEach(function(slot) {
188-
if (!slot.divider) {
189-
slots.value = values[valueIndexCount];
190-
valueIndexCount = valueIndexCount + 1;
191-
}
188+
if (!slot.divider) slot.value = values[valueIndexCount++];
192189
});
193190
}
194191
},

0 commit comments

Comments
 (0)