[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,8 +259,11 @@ export default create({
}
value = this.correctValue(value);
this.innerValue = value;
this.$nextTick(() => {
this.$emit('change', picker);
this.$nextTick(() => {
this.$emit('change', picker);
});
});
},
@ -290,15 +293,8 @@ export default create({
}
this.$nextTick(() => {
this.setColumnByValues(values);
this.$refs.picker.setValues(values);
});
},
setColumnByValues(values) {
if (!this.$refs.picker) {
return;
}
this.$refs.picker.setValues(values);
}
},