mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 13:50:36 +03:00
feat: emit clear event for the clear button
This commit is contained in:
@@ -153,9 +153,11 @@ export default {
|
|||||||
|-----------------|------------------------------|------------------------|
|
|-----------------|------------------------------|------------------------|
|
||||||
| change | When the value change | the currentValue |
|
| change | When the value change | the currentValue |
|
||||||
| input | 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 |
|
| input-error | When user type a invalid Date| the input text |
|
||||||
|
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ export default {
|
|||||||
const date = this.range ? [null, null] : null
|
const date = this.range ? [null, null] : null
|
||||||
this.currentValue = date
|
this.currentValue = date
|
||||||
this.updateDate(true)
|
this.updateDate(true)
|
||||||
|
this.$emit('clear')
|
||||||
},
|
},
|
||||||
confirmDate () {
|
confirmDate () {
|
||||||
const valid = this.range ? isValidRange(this.currentValue) : isValidDate(this.currentValue)
|
const valid = this.range ? isValidRange(this.currentValue) : isValidDate(this.currentValue)
|
||||||
|
|||||||
Reference in New Issue
Block a user