FulLCalendar 5:每个事件源的颜色不同;无法在月视图中显示
我有两个事件源,配置如下:FulLCalendar 5:每个事件源的颜色不同;无法在月视图中显示,fullcalendar,fullcalendar-5,Fullcalendar,Fullcalendar 5,我有两个事件源,配置如下: this.eventSources = { 1: { id: 1, color: '#228B22', textColor: '#000000', backgroundColor: '#90EE90', url: this.config.loadUrl, startParam: 'from',
this.eventSources = {
1: {
id: 1,
color: '#228B22',
textColor: '#000000',
backgroundColor: '#90EE90',
url: this.config.loadUrl,
startParam: 'from',
endParam: 'to',
extraParams: {
client_id: 0,
agenda_item_type_id: 1
}
},
2: {
id: 2,
color: '#0e64a0',
textColor: '#000000',
backgroundColor: '#87CEFA',
url: this.config.loadUrl,
startParam: 'from',
endParam: 'to',
extraParams: {
client_id: 0,
agenda_item_type_id: 2
}
}
};
我在calender.render()之前设置它们,如下所示:
Object.values(this.agendaItemTypes).forEach(itemType => {
if (itemType.initiallyVisible) {
this.calendar.addEventSource(this.eventSources[itemType.id]);
}
});
this.calendar.render();
这个很好用。初始渲染后,仅显示initiallyVisible
事件。使用复选框,我可以切换每种事件类型的可见性,这几乎可以按预期工作。只有颜色没有按预期显示。使用标准主题,dayGridMonth
视图中的项目符号将以配置的颜色显示。除此之外,事件以默认颜色显示,似乎忽略了事件源的textColor
和backgroundColor
我是否遗漏了文档中的某些内容,或者是否有明显的错误