Skip to content

Commit b1a5a41

Browse files
committed
fix: calendar-change event frequency
1 parent 391cc97 commit b1a5a41

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/calendar.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,17 @@ export default {
231231
}
232232
} else {
233233
this.showPanelNone()
234+
this.updateNow(this.value)
234235
}
235236
},
236237
// 根据value更新日历
237238
updateNow (value) {
238239
const now = value ? new Date(value) : new Date()
239240
const oldNow = new Date(this.now)
240-
this.dispatch('DatePicker', 'calendar-change', [now, oldNow])
241241
this.now = now
242+
if (this.visible) {
243+
this.dispatch('DatePicker', 'calendar-change', [now, oldNow])
244+
}
242245
},
243246
getCriticalTime (value) {
244247
if (!value) {

0 commit comments

Comments
 (0)