ReferenceError:未定义FullCalendar [英] ReferenceError: FullCalendar is not defined
本文介绍了ReferenceError:未定义FullCalendar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在尝试通过使用文档中提供的示例来实现fullcalendar.当我尝试运行它时,出现此错误:
I've been trying to implement fullcalendar now by using the example provided in the docs. When I try to run it, I get this Error:
ReferenceError:未定义FullCalendar
ReferenceError: FullCalendar is not defined
我知道此消息的含义,但是我必须在何处以及如何对其进行定义?
I know what this message means, but where and how do I have to define it?
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'dayGrid', 'list', 'googleCalendar' ],
header: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,listYear'
},
displayEventTime: false, // don't show the time column in list view
googleCalendarApiKey: 'AIzaSyDU6o_4vQlJbLRI8Tb3TCnCRGi2GsiB***',
// US Holidays
events: 'en.usa#holiday@group.v.calendar.google.com',
eventClick: function(arg) {
// opens events in a popup window
window.open(arg.event.url, '_blank', 'width=700,height=600');
// prevents current tab from navigating
arg.jsEvent.preventDefault();
}
});
calendar.render(); });
我16岁,因此没有经验.因此,如果这个问题看起来太简单了,对不起. 谢谢您的帮助.
I'm 16 y/o and therefore somewhat unexperienced. So if this question seems too simple, I'm sorry. Thank you for your help.
推荐答案
只需在顶部添加
declare var FullCalendar: any;
这篇关于ReferenceError:未定义FullCalendar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文