首页 > 解决方案 > ReactJS禁用在完整日历中的选定日期之外拖动

问题描述

我有一个标准的完整日历设置,带有拖放交互插件。我的问题是如何处理拖放选择,以及如何处理移动设备上的触摸事件。我在完整的日历文档中找不到任何有用的东西。最重要的是,我想禁用在选定日期之外的拖动,是否可以编写自定义函数来处理这一切?

从“@fullcalendar/react”导入 FullCalendar 从“@fullcalendar/daygrid”导入 dayGridPlugin 从“@fullcalendar/timegrid”导入 timeGridPlugin 从“@fullcalendar/interaction”导入interactionPlugin 从“@fullcalendar/core/locales-all”导入 allLocales来自“@fullcalendar/moment-timezone”的 momentTimezonePlugin

<FullCalendar
            nowIndicator
            plugins={[momentTimezonePlugin, timeGridPlugin, dayGridPlugin, interactionPlugin]}
            initialView="timeGridWeek"
            headerToolbar={{
              left: 'prev,next today',
              center: 'title',
              right: 'dayGridMonth,timeGridWeek,timeGridDay',
            }}
            ref={calendarRef}
            editable
            selectable
            selectMirror
            dayMaxEvents
            weekends
            select={(e) => handleEventAdd(e)}
            eventClick={(e) => handleEventUpdate(e)}
            events={currentevents}
            eventDrop={(e) => handleupdateSchedule(e)}
          />

标签: reactjsfullcalendarfullcalendar-5

解决方案


推荐阅读