mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 16:30:36 +03:00
fix: calendar-change event frequency
This commit is contained in:
+4
-1
@@ -231,14 +231,17 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.showPanelNone()
|
this.showPanelNone()
|
||||||
|
this.updateNow(this.value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 根据value更新日历
|
// 根据value更新日历
|
||||||
updateNow (value) {
|
updateNow (value) {
|
||||||
const now = value ? new Date(value) : new Date()
|
const now = value ? new Date(value) : new Date()
|
||||||
const oldNow = new Date(this.now)
|
const oldNow = new Date(this.now)
|
||||||
this.dispatch('DatePicker', 'calendar-change', [now, oldNow])
|
|
||||||
this.now = now
|
this.now = now
|
||||||
|
if (this.visible) {
|
||||||
|
this.dispatch('DatePicker', 'calendar-change', [now, oldNow])
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getCriticalTime (value) {
|
getCriticalTime (value) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user