mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-09 01:42:27 +03:00
fix: calendar-change event frequency
This commit is contained in:
+4
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user