带有primeng fullcalendar 的angular9 抛出错误:找不到命名空间“FullCalendarVDom".和“请导入顶级全日历库" [英] angular9 with primeng fullcalendar throws errors: Cannot find namespace 'FullCalendarVDom'. and 'Please import the top-level fullcalendar lib'

查看:235
本文介绍了带有primeng fullcalendar 的angular9 抛出错误:找不到命名空间“FullCalendarVDom".和“请导入顶级全日历库"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 angular 应用中使用了primeng p-fullcalendar.

I use primeng p-fullcalendar in my angular app.

我在命令行中收到此错误:'找不到命名空间'FullCalendarVDom'

I get this error in command-line: 'Cannot find namespace 'FullCalendarVDom'

在浏览器中:'在尝试导入插件之前,请先导入顶级 fullcalendar 库.'

and in browser: 'Please import the top-level fullcalendar lib before attempting to import a plugin.'

我的代码:

import { FullCalendar } from 'primeng/fullcalendar';
import { Calendar } from '@fullcalendar/core';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction';

@ViewChild('calendar', { static: true }) private calendar: FullCalendar;

在 c'tor 中:

 this.events = [{
   "title": "Conference",
   "start": "2016-01-11",
   "end": "2016-01-13"
 }];
 this.options = {
   plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
   defaultDate: '2017-02-01',
   header: {
     left: 'prev,next',
     center: 'title',
     right: 'month,agendaWeek,agendaDay'
   }

我根据预览答案添加了这些导入,但没有帮助.

I added these imports according to preview answers, but it did not help.

我错过了什么?

推荐答案

Primeng 使用 FullCalendar 4.1,而不是安装最新版本的 FullCalendar 尝试安装 v4.1.

Primeng working with FullCalendar 4.1, instead of instaling latest version of FullCalendar try to install v4.1.

npm i @fullcalendar/core@4.1.0
npm i @fullcalendar/interaction@4.1.0
npm i @fullcalendar/daygrid@4.1.0
npm i @fullcalendar/timegrid@4.1.0

这篇关于带有primeng fullcalendar 的angular9 抛出错误:找不到命名空间“FullCalendarVDom".和“请导入顶级全日历库"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆