Unless you're using Bootstrap, the grid shows up fine.(除非您使用Bootstrap,否则网格显示会很好。)
The example below uses an identical configuration to your <FullCalendar>
attributes.(下面的示例使用与<FullCalendar>
属性相同的配置。)
Edit: Added the Bootstrap theme and the columns are still separated.(编辑:添加了Bootstrap主题,列仍然分开。)
plugins: [ 'bootstrap', ... ],
themeSystem: 'bootstrap'
Edit #2: If you REALLY want to style the columns, you can try this:(编辑#2:如果您确实要为列设置样式,则可以尝试以下操作:)
.fc-widget-content {
border-right: 2px solid #EE7 !important; /* Line thickness is 2px to better show */
}
.fc-widget-content:first-child {
border-right: inherit !important; /* Revert the first child */
}
document.addEventListener('DOMContentLoaded', function() { var calendarEl = document.getElementById('calendar'); var calendar = new FullCalendar.Calendar(calendarEl, { plugins: [ 'dayGrid', 'timeGrid' ], defaultView: 'timeGridWeek', locale: 'fr', allDaySlot: false, nowIndicator: true, hiddenDays: [0], slotDuration: '00:45:00', minTime: "07:00:00", maxTime: "20:00:00", slotEventOverlap: false, handleWindowResize: true, eventLimit: true, displayEventEnd: true, header : { left: "prev,next today", center: "title", right: "dayGridMonth,timeGridWeek,timeGridDay" } }); calendar.render(); });
.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; }
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/core/main.min.css" rel="stylesheet" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/daygrid/main.min.css" rel="stylesheet" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/timegrid/main.min.css" rel="stylesheet" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/bootstrap/main.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/core/main.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/core/locales/fr.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/daygrid/main.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/timegrid/main.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/bootstrap/main.min.js"></script> <div id="calendar"></div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…