我正在使用全日历(https://fullcalendar.io)进行响应,我的问题是当我在周视图中创建事件并尝试进入月视图时,控制台显示此错误:
Uncaught TypeError: view.computeEventDraggable is not a function
at TimeGridEventRenderer.renderSegHtml (main.esm.js: 155)
at TimeGridEventRenderer.FgEventRenderer.renderSegEls (main.js: 9531)
at TimeGridEventRenderer.FgEventRenderer.renderSegs (main.js: 9486)
at TimeGrid.res [as renderFgEvents] (main.js: 3911)
at TimeGrid.render (main.esm.js: 628)
at TimeGrid.Component.receiveProps (main.js: 4802)
at SimpleTimeGrid.render (main.esm.js: 1427)
at SimpleTimeGrid.Component.receiveProps (main.js: 4802)
at TimeGridView.render (main.esm.js: 1563)
at TimeGridView.Component.receiveProps (main.js: 4802)
at CalendarComponent.renderView (main.js: 7639)
at CalendarComponent.render (main.js: 7549)
at CalendarComponent.Component.receiveProps (main.js: 4802)
at Calendar.renderComponent (main.js: 8298)
at Calendar.executeRender (main.js: 8250)
at Calendar.tryRerender (main.js: 8227)
at Calendar.requestRerender (main.js: 8218)
at Calendar.dispatch (main.js: 8201)
at Calendar.changeView (main.js: 8538)
at HTMLButtonElement.buttonClick (main.js: 7389)
我的全日历声明看起来像这样
<FullCalendar
defaultView="dayGridMonth"
header={{
left: "prev,next today",
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek"
}}
rerenderDelay={10}
eventDurationEditable={false}
editable={true}
droppable={true}
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
ref={this.calendarComponentRef}
weekends={this.state.calendarWeekends}
events={this.state.calendarEvents}
eventDrop={this.drop}
drop={this.drop}
eventReceive={this.eventReceive}
eventClick={this.eventClick}
dateClick={ this.handleDateClick }
/>
非常感谢您的帮助
答案 0 :(得分:0)
我的问题通过下载书店版本解决了:
初始版本"@ fullcalendar / interaction": "^ 4.3.0"
。适用于"@ fullcalendar / interaction": "4.2.0"
的版本。