diff --git a/src/date-picker.js b/src/date-picker.js index 39bf67c..c967e3b 100644 --- a/src/date-picker.js +++ b/src/date-picker.js @@ -351,11 +351,14 @@ export default { this.emitValue(val, this.validMultipleType ? `multiple-${type}` : type); } }, - handleClear(evt) { - evt.stopPropagation(); + clear() { this.emitValue(this.range ? [null, null] : null); this.$emit('clear'); }, + handleClear(evt) { + evt.stopPropagation(); + this.clear(); + }, handleConfirmDate() { const value = this.emitValue(this.currentValue); this.$emit('confirm', value); @@ -398,7 +401,7 @@ export default { const text = this.userInput.trim(); this.userInput = null; if (text === '') { - this.handleClear(); + this.clear(); return; } let date;