类型“typeof FullCalendarModule”上不存在属性“registerPlugins”

问题描述 投票:0回答:1

尝试将 fullcalendar 集成到我的 Angular 15 项目中并遵循以下步骤:

错误:src/app/views/pages/takvim/takvim.module.ts:18:20 - 错误 TS2339:类型“typeof FullCalendarModule”上不存在属性“registerPlugins”。

FullCalendarModule.registerPlugins([
  // register FullCalendar plugins
  dayGridPlugin,
  interactionPlugin,
]);

package.json

"fullcalendar": "^6.1.8",
"@fullcalendar/angular": "^6.1.8",
"@fullcalendar/core": "^6.1.8",
"@fullcalendar/daygrid": "^6.1.8",
"@fullcalendar/interaction": "^6.1.8",

app.module.ts

import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";

import { TakvimRoutingModule } from "./takvim-routing.module";
import { FormsModule } from "@angular/forms";
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { SweetAlert2Module } from "@sweetalert2/ngx-sweetalert2";
import { TableModule } from "primeng/table";
import { ButtonModule } from "primeng/button";
import { NgSelectModule } from "@ng-select/ng-select";
import { TakvimComponent } from "./takvim.component";
import { FullCalendarModule } from "@fullcalendar/angular"; // must go before plugins
import dayGridPlugin from "@fullcalendar/daygrid"; // a plugin!
import interactionPlugin from "@fullcalendar/interaction"; // a plugin!
import { PerfectScrollbarModule } from "ngx-perfect-scrollbar";
import { CalendarModule } from "primeng/calendar";
FullCalendarModule.registerPlugins([
  // register FullCalendar plugins
  dayGridPlugin,
  interactionPlugin,
]);

@NgModule({
  declarations: [TakvimComponent],
  imports: [
    CommonModule,
    TakvimRoutingModule,
    FormsModule,
    NgbModule,
    PerfectScrollbarModule,
    FeahterIconModule,
    CalendarModule,
    SweetAlert2Module.forChild(),
    TableModule,
    ButtonModule,
    NgSelectModule,
    FullCalendarModule, // register FullCalendar with you app
  ],
})
export class TakvimModule {}

angular fullcalendar
1个回答
0
投票

我要添加component.ts

插件:[dayGridPlugin,interactionPlugin],

 calendarOptions: CalendarOptions = {
    plugins: [dayGridPlugin, interactionPlugin],
    initialView: "dayGridMonth",
    locale: "tr",

    dateClick: this.handleDateClick.bind(this), // bind is important!
    eventColor: "#378006",
    eventBackgroundColor: "#FF8C00",
    selectable: false,
    themeSystem: "bootstrap",
    buttonText: {
      today: "Bugün",
    },
    events: [],
  };

这就是我解决你问题的方法

© www.soinside.com 2019 - 2024. All rights reserved.