mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-24 09:20:35 +03:00
fix: close popup after select range
This commit is contained in:
+8
-3
@@ -392,10 +392,15 @@ export default {
|
|||||||
},
|
},
|
||||||
selectRange (range) {
|
selectRange (range) {
|
||||||
if (typeof range.onClick === 'function') {
|
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 () {
|
clearDate () {
|
||||||
const date = this.range ? [null, null] : null
|
const date = this.range ? [null, null] : null
|
||||||
|
|||||||
Reference in New Issue
Block a user