From 52bd1fee572c66abd49772ec2431fc086e5048e7 Mon Sep 17 00:00:00 2001 From: mengxiong10 <15623530290@163.com> Date: Mon, 2 Dec 2019 11:01:54 +0800 Subject: [PATCH] fix: can't clear input box --- src/date-picker.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/date-picker.vue b/src/date-picker.vue index 7534c5b..14a14b8 100644 --- a/src/date-picker.vue +++ b/src/date-picker.vue @@ -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);