You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

FullCalendar V6(Angular) Timegrid插件:allDaySlot不识别,如何隐藏全天栏?

解决FullCalendar 6.x中allDaySlot参数不被识别的问题

FullCalendar从v6版本开始调整了配置结构,allDaySlot不再是全局CalendarOptions的属性,而是被归类到timegrid插件的专属配置项里,直接全局配置自然会触发TS类型错误。

解决方法很简单,把allDaySlot放到timeGrid配置对象里就行:

import { Component } from '@angular/core';
import { CalendarOptions } from '@fullcalendar/angular';
import timeGridPlugin from '@fullcalendar/timegrid';

@Component({
  selector: 'app-calendar',
  templateUrl: './calendar.component.html',
})
export class CalendarComponent {
  calendarOptions: CalendarOptions = {
    plugins: [timeGridPlugin],
    // 其他全局配置项(比如headerToolbar、initialView等)
    timeGrid: {
      allDaySlot: false // 在这里配置全天栏的显示/隐藏
    }
  };
}

注意两点:

  • 确保timegrid插件已经在plugins数组里注册(你当前安装的版本已经包含这个插件,只要注册就行)
  • 不同视图的专属配置都要放到对应插件的配置对象下,比如dayGrid视图的相关配置要放到dayGrid对象里

内容的提问来源于stack exchange,提问作者Archonite

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 16:12:34