2
0
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:
mengxiong10
2019-04-30 19:53:50 +08:00
parent d9ec1043a7
commit 5823f85693
+8 -3
View File
@@ -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