mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 20:00:36 +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);
|
return this.value2date(this.value);
|
||||||
},
|
},
|
||||||
text() {
|
text() {
|
||||||
if (this.userInput) {
|
if (this.userInput !== null) {
|
||||||
return this.userInput;
|
return this.userInput;
|
||||||
}
|
}
|
||||||
if (!this.isValidValue(this.innerValue)) {
|
if (!this.isValidValue(this.innerValue)) {
|
||||||
@@ -343,6 +343,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
emitValue(date, type) {
|
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);
|
const value = Array.isArray(date) ? date.map(this.date2value) : this.date2value(date);
|
||||||
this.$emit('input', value);
|
this.$emit('input', value);
|
||||||
this.$emit('change', value, type);
|
this.$emit('change', value, type);
|
||||||
|
|||||||
Reference in New Issue
Block a user