在fullCalendar中更改slotDuration而不重新加载页面

use*_*232 4 javascript fullcalendar

使用fullcalendar我需要没有页面重新加载来slotDuration根据其他条件更改参数:

我在一个案例中做

$('#calendar').fullCalendar('option', 'slotDuration', '00:15:00');
Run Code Online (Sandbox Code Playgroud)

而在其他情况下

$('#calendar').fullCalendar('option', 'slotDuration', '00:30:00');
Run Code Online (Sandbox Code Playgroud)

但看起来它不起作用,因为我总是看到fullcalendar与slotDuration=30(2个插槽)分钟,因为它在初始化时被调用.

如果有办法吗?

Aka*_*ash 6

现在,你可以设置dynamically destoryingcalendar.

$('#cc-calendar')
  .fullCalendar('option','slotDuration','00:10:00');
Run Code Online (Sandbox Code Playgroud)

在这里,我们使用的Dynamically get/set Options功能fullcalendar.

有关详细信息,请查看:https://fullcalendar.io/docs/utilities/dynamic_options/

祝好运.