src/views/wel/components/calendarBox.vue
@@ -59,16 +59,10 @@ const newDate = dayjs(newV); const oldDate = dayjs(oldV); // 格式化为 YYYY-MM-DD HH:mm:ss const newDateStr = newDate.format('YYYY-MM-DD HH:mm:ss'); const oldDateStr = oldDate.format('YYYY-MM-DD HH:mm:ss'); params. console.log('新日期:', newDateStr, '旧日期:', oldDateStr); if (newDate.isBefore(oldDate, 'month')) { console.log('点击了上个月',newDateStr); console.log('点击了上个月'); } else if (newDate.isAfter(oldDate, 'month')) { console.log('点击了下个月',newDateStr); console.log('点击了下个月'); } } },