Skip to content

Commit

Permalink
fix: calendar-change event frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Oct 30, 2018
1 parent 391cc97 commit b1a5a41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,17 @@ export default {
}
} else {
this.showPanelNone()
this.updateNow(this.value)
}
},
// 根据value更新日历
updateNow (value) {
const now = value ? new Date(value) : new Date()
const oldNow = new Date(this.now)
this.dispatch('DatePicker', 'calendar-change', [now, oldNow])
this.now = now
if (this.visible) {
this.dispatch('DatePicker', 'calendar-change', [now, oldNow])
}
},
getCriticalTime (value) {
if (!value) {
Expand Down

0 comments on commit b1a5a41

Please sign in to comment.