【发布时间】:2019-11-27 15:22:01
【问题描述】:
我有一个FullCalendar:
import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";
// must manually import the stylesheets for each plugin
import "@fullcalendar/core/main.css";
import "@fullcalendar/daygrid/main.css";
import "@fullcalendar/timegrid/main.css";
<FullCalendar
locale={frLocale}
allDaySlot={false}
defaultView="timeGridWeek"
nowIndicator={true}
hiddenDays={[0]}
slotDuration='00:45:00'
minTime="07:00:00"
maxTime="20:00:00"
slotEventOverlap={false}
handleWindowResize={true}
header={{
left: "prev,next today",
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay"
}}
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin ]}
ref={this.calendarComponentRef}
events={this.state.events}
displayEventEnd={true}
/>
当我运行它时,我得到:
我想像黄线一样分隔天数:
我的package.json:
我尝试添加这个 css:
.fc-timeGrid-view .fc-time-grid tbody tr:nth-of-type(even) {
background: rgba(246, 246, 246, 0.667);
}
.fc-timeGrid-view .fc-widget-content {
border-right: 2px solid #EE7 !important;
}
.fc-timeGrid-view .fc-widget-content:first-child {
border-right: inherit !important;
}
但它不起作用,我希望日历的背景颜色为白色。
我该如何解决?
【问题讨论】:
-
您使用的是哪个版本的完整日历?
-
@Mr.Polywhirl v4
-
@CodeLover 它适用于我。 codesandbox.io/s/fullcalendar-react-8r38x
-
@DragonWhite 你加了什么?我试了一下,还是不行。
标签: javascript reactjs bootstrap-4 fullcalendar fullcalendar-4