angular - 类型“CalendarOptions”.ts(2339) 上不存在属性“getDate”
问题描述
我正在尝试取回日历的当前月份和年份,但是我收到一条错误消息,上面写着“'CalendarOptions'.ts(2339) 类型上不存在属性'getDate'”。我正在使用这个日历https://fullcalendar.io/docs/Calendar-getDate。我已按照说明进行操作,尽管我使用的是打字稿并且说明是用 javascript 编写的。
getDate() {
const getDates = this.calendarOptions.getDate();
}
上有一个错误下划线.getDate();
。我查看了 API,并且该方法确实存在于包中。
下面是日历初始化
calendarOptions: CalendarOptions = {
plugins: [ dayGridPlugin, timeGridPlugin, interactionPlugin],
initialView: 'timeGridWeek',
headerToolbar: {
left: 'prev,next',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
dateClick: this.handleDateClick.bind(this),
events: []
};
解决方案
推荐阅读
- mysql - 创建触发器但出现未知列错误。if 语句有问题?
- angular - Angular 材料步进器在 ng 服务期间不会编译
- javascript - XPages 动态内容控件:事件处理程序被错误触发
- java - 使用没有操作栏的主题时,如何在 Android 中隐藏应用程序的名称?
- mysql - 使用 XAMPP 找不到服务器 IP 地址
- javascript - 如何在 DELETE express 函数中重定向?
- c# - 启动应用程序时 Xamarin 清空 SwipeCardView
- node.js - 尝试安装 react-redux 依赖项时出错
- javascript - 如何在 Firebase RTDB 中获得原子增量值?
- javascript - Javascript 字符串到枚举