Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在React中使用Fullcalendar更新事件_Reactjs_Fullcalendar - Fatal编程技术网

Reactjs 在React中使用Fullcalendar更新事件

Reactjs 在React中使用Fullcalendar更新事件,reactjs,fullcalendar,Reactjs,Fullcalendar,因此,我正在尝试使用FullCalendar,我希望用户能够编辑事件详细信息,单击“更新”,然后在本地更新事件,然后将其推送到服务器。我有以下代码,但问题是当有多个更改时,会多次调用事件回调。有没有一种方法可以只做一次就可以节省很多API调用?这是我的密码 let currentEvent=calendarApi.getEventById(eventId); currentEvent.setExtendedProp('notes',notes); currentEvent.setExtended

因此,我正在尝试使用FullCalendar,我希望用户能够编辑事件详细信息,单击“更新”,然后在本地更新事件,然后将其推送到服务器。我有以下代码,但问题是当有多个更改时,会多次调用事件回调。有没有一种方法可以只做一次就可以节省很多API调用?这是我的密码

let currentEvent=calendarApi.getEventById(eventId);
currentEvent.setExtendedProp('notes',notes);
currentEvent.setExtendedProp('person',person);
也许我在文档中没有看到另一种方法?

用于实现的未记录方法接受可以有多个属性的对象。您可以这样使用它:

event.mutate({
  extendedProps: {
    notes: notes,
    person: person,
  },
})
或者,使用对象属性值速记:

event.mutate({extendedProps: {notes, person}})
我绝对没有使用FullCalendar的经验,所以使用时请自行承担风险