DatePicker, TimePicker support value null

This commit is contained in:
梁灏 2021-09-15 17:58:03 +08:00
parent 6ebd9456f0
commit 0ddc59a168

View file

@ -805,11 +805,12 @@
}, },
}, },
mounted () { mounted () {
const initialValue = this.value; // null
const parsedValue = this.publicVModelValue; // const initialValue = this.value;
if (typeof initialValue !== typeof parsedValue || JSON.stringify(initialValue) !== JSON.stringify(parsedValue)){ // const parsedValue = this.publicVModelValue;
this.$emit('input', this.publicVModelValue); // to update v-model // if (typeof initialValue !== typeof parsedValue || JSON.stringify(initialValue) !== JSON.stringify(parsedValue)){
} // this.$emit('input', this.publicVModelValue); // to update v-model
// }
if (this.open !== null) this.visible = this.open; if (this.open !== null) this.visible = this.open;
// to handle focus from confirm buttons // to handle focus from confirm buttons