Javascript 启动日程安排(日历)问题加载日历
我正在尝试实现启动计划组件。从他们的文档来看,这是一个需要第三方api(Moment、FullCalendar)的特殊性。 因此,我包括了依赖项,甚至安装了@types/jquery,但每当我运行应用程序时,都会出现以下错误: 错误类型错误:e.addClass不是函数 在t.initialRender(fullcalendar.min.js:10) 在t.render(fullcalendar.min.js:10) at Schedule.push../node_modules/priming/components/Schedule/Schedule.js.Schedule.initialize(Schedule.js:222) at Schedule.push../node_modules/priming/components/Schedule/Schedule.js.Schedule.ngAfterViewChecked(Schedule.js:208) 在callProviderLifecycles(core.js:9355) 在callElementProvidersLifecycles(core.js:9326) 在callLifecycleHooksChildrenFirst(core.js:9316) 在checkAndUpdateView(core.js:10252)上 在callViewAction上(core.js:10484) 在执行EmbeddedViewsAction时(core.js:10447) 这似乎是一个jquery问题,但我确保它在那里并已加载,我还使用了来自官方Priming showcase的数据源和示例代码 数据来源:Javascript 启动日程安排(日历)问题加载日历,javascript,angular,typescript,fullcalendar,primeng,Javascript,Angular,Typescript,Fullcalendar,Primeng,我正在尝试实现启动计划组件。从他们的文档来看,这是一个需要第三方api(Moment、FullCalendar)的特殊性。 因此,我包括了依赖项,甚至安装了@types/jquery,但每当我运行应用程序时,都会出现以下错误: 错误类型错误:e.addClass不是函数 在t.initialRender(fullcalendar.min.js:10) 在t.render(fullcalendar.min.js:10) at Schedule.push../node_modules/priming
ngOnInit() {
this.events = [
{
"title": "All Day Event",
"start": "2016-01-01"
},
{
"title": "Long Event",
"start": "2016-01-07",
"end": "2016-01-10"
},
{
"title": "Repeating Event",
"start": "2016-01-09T16:00:00"
},
{
"title": "Repeating Event",
"start": "2016-01-16T16:00:00"
},
{
"title": "Conference",
"start": "2016-01-11",
"end": "2016-01-13"
}
];
}
以下是组件模板:
>
安装fullcalendar@4.0.0-alpha
为我解决了问题
my angular.json的一部分:
"styles": [
"src/styles.css",
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/omega/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/fullcalendar/dist/fullcalendar.min.css"
],
"scripts": [
"node_modules/moment/min/moment.min.js",
"node_modules/fullcalendar/dist/fullcalendar.min.js"
]
我希望它也能帮助你 非常好,谢谢你!npm:npm安装fullcalendar@4.0.0-alphafullcalendar@4.0.0-阿尔法还没有准备好。dayClick事件有一个bug:当点击某些晚些时候(点击晚上11点)时,不会触发事件。时间通常会缩短30分钟。下面是该bug的参考[.滚动包含日历的窗口时会发生这种情况。我们需要找到一种方法使Priming与fullcalendar V3配合使用。您可以通过将日历保持足够小,使窗口没有滚动条来解决fullcalendar v4的问题。在模板中:
[height]=“customHeightOfCalendar”(onViewRender)=“handleViewRender”($event)“
在组件中:handleViewRender(e){this.customHeightOfCalendar=window.innerHeight*0.85;}