From e0776b6c83c8f15d620f47c6b3436172e97d1d66 Mon Sep 17 00:00:00 2001 From: mxie <15623530290@163.com> Date: Thu, 6 Sep 2018 18:50:50 +0800 Subject: [PATCH] feat: emit `clear` event for the clear button --- README.md | 4 +++- src/index.vue | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a8e9c86..17ebba76 100644 --- a/README.md +++ b/README.md @@ -153,9 +153,11 @@ export default { |-----------------|------------------------------|------------------------| | change | When the value change | the currentValue | | input | When the value change | the currentValue | -| confirm | When user click 'OK' button | the currentValue | +| confirm | When click 'OK' button | the currentValue | +| clear | When click 'clear' button | | | input-error | When user type a invalid Date| the input text | + ### Slots | Name | Description | diff --git a/src/index.vue b/src/index.vue index 8e8a18a4..38a902ed 100644 --- a/src/index.vue +++ b/src/index.vue @@ -320,6 +320,7 @@ export default { const date = this.range ? [null, null] : null this.currentValue = date this.updateDate(true) + this.$emit('clear') }, confirmDate () { const valid = this.range ? isValidRange(this.currentValue) : isValidDate(this.currentValue)