import { Calendar } from '@fullcalendar/react';
import interactionPlugin from '@fullcalendar/interaction';
const MyCalendarComponent = () => {
const handleEventClick = (info) => {
// Your event click logic here
};
return (
<Calendar
plugins={[interactionPlugin]}
events={[
// your event data here
]}
eventClick={handleEventClick}
eventPopover={{
enabled: true,
// By default, clicking outside of the popover will close it.
// To prevent this, set the interaction.enabled property to false.
interaction: {
enabled: false,
},
}}
/>
);
};
export default MyCalendarComponent;
1条答案
按热度按时间dhxwm5r41#
若要防止在弹出窗口外部单击时关闭弹出窗口,可以使用FullCalendar中的交互对象。具体来说,可以将弹出框类型的enabled属性设置为false。这样,当在弹出窗口外部单击时,弹出窗口不会关闭。
示例如下:
您也可以参考this