Skip to content

Commit

Permalink
fix: close popup after select range
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Apr 30, 2019
1 parent d9ec104 commit 5823f85
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5823f85

Please sign in to comment.