【Vue】fullcalendar

您所在的位置:网站首页 fullcalendar点击日期,怎么触发事件 【Vue】fullcalendar

【Vue】fullcalendar

2024-07-10 21:44| 来源: 网络整理| 查看: 265

如(4条消息) fullcalendar - next ,prev等切换月份回调处理_Q.E.D.的博客-CSDN博客_fullcalendar prev这篇博客所说,fullcalendar next ,prev等切换月份的按钮是没有回调函数,需要在customButtons中添加自定义按钮

customButtons: { next: { click: this.nextClick }, prev: { click: this.prevClick } },

methods中

nextClick(mouseEvent, htmlElement) { console.log("next.............") this.$refs.fullCalendar.getApi().next() // 将日历向前移动一步(例如,一个月或一周)。

     // 打印日历显示的时间范围 console.log(this.$refs.fullCalendar.getApi().view.currentStart.getTime()); console.log(this.$refs.fullCalendar.getApi().view.currentEnd.getTime()); // 如果dayGridMonth查看日历,则将日历向前移动一个月。 // 如果日历位于dayGridWeek或中timeGridWeek,则将日历向前移动一周。 // 如果日历位于dayGridDay或中timeGridDay,则将日历向前移动一天。 }, prevClick(mouseEvent, htmlElement) { console.log("prev.............") this.$refs.fullCalendar.getApi().prev() // 将日历后退一步(例如,一个月或一周)。 // 如果dayGridMonth查看日历,则将日历后移一个月。 // 如果日历位于dayGridWeek或中timeGridWeek,则将日历后移一周。 // 如果日历位于dayGridDay或中timeGridDay,则将日历移回一天。 },

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3