2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-10 00:22:28 +03:00

fix: can't clear input box

This commit is contained in:
mengxiong10
2019-12-02 11:01:54 +08:00
parent 4d935d7e24
commit 52bd1fee57
+3 -1
View File
@@ -259,7 +259,7 @@ export default {
return this.value2date(this.value);
},
text() {
if (this.userInput) {
if (this.userInput !== null) {
return this.userInput;
}
if (!this.isValidValue(this.innerValue)) {
@@ -343,6 +343,8 @@ export default {
}
},
emitValue(date, type) {
// fix IE11/10 trigger input event when input is focused. (placeholder !== '')
this.userInput = null;
const value = Array.isArray(date) ? date.map(this.date2value) : this.date2value(date);
this.$emit('input', value);
this.$emit('change', value, type);