mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-13 06:52:28 +03:00
fix: close popup after select range
This commit is contained in:
+8
-3
@@ -392,10 +392,15 @@ export default {
|
||||
},
|
||||
selectRange (range) {
|
||||
if (typeof range.onClick === 'function') {
|
||||
return range.onClick(this)
|
||||
const close = range.onClick(this)
|
||||
if (close !== false) {
|
||||
this.closePopup()
|
||||
}
|
||||
} else {
|
||||
this.currentValue = [new Date(range.start), new Date(range.end)]
|
||||
this.updateDate(true)
|
||||
this.closePopup()
|
||||
}
|
||||
this.currentValue = [new Date(range.start), new Date(range.end)]
|
||||
this.updateDate(true)
|
||||
},
|
||||
clearDate () {
|
||||
const date = this.range ? [null, null] : null
|
||||
|
||||
Reference in New Issue
Block a user