[bugfix] DatetimePicker: change event trigger timing (#1370)

This commit is contained in:
neverland 2018-07-01 07:37:23 +08:00 committed by GitHub
parent 0afbd92d32
commit e820e072e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,9 +259,12 @@ export default create({
} }
value = this.correctValue(value); value = this.correctValue(value);
this.innerValue = value; this.innerValue = value;
this.$nextTick(() => {
this.$nextTick(() => { this.$nextTick(() => {
this.$emit('change', picker); this.$emit('change', picker);
}); });
});
}, },
updateColumnValue(value) { updateColumnValue(value) {
@ -290,15 +293,8 @@ export default create({
} }
this.$nextTick(() => { this.$nextTick(() => {
this.setColumnByValues(values);
});
},
setColumnByValues(values) {
if (!this.$refs.picker) {
return;
}
this.$refs.picker.setValues(values); this.$refs.picker.setValues(values);
});
} }
}, },