Skip to content

Commit

Permalink
feat: emit clear event for the clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Sep 6, 2018
1 parent 6d7d465 commit e0776b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e0776b6

Please sign in to comment.