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:
+3
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user