1

我想在vue-class-component中使用FullCalendar vue ,但无法使其正常工作。

按照FullCalendar 文档,我可以将它与提供的示例一起使用。一旦翻译成vue-class-component,我就很挣扎。主要是声明 FullCalendar 组件不起作用。

import { Component, Vue } from "vue-property-decorator";
import FullCalendar from '@fullcalendar/vue';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction';
import { PluginDef } from '@fullcalendar/core';

@Component({
  components: {
    FullCalendar
  }
})
export default class Dashboard extends Vue {

  calendarPlugins: PluginDef[] = [dayGridPlugin, timeGridPlugin, interactionPlugin];
[...]

这给了我以下错误:

ERROR in xxx\dashboard.component.ts
[tsl] ERROR in xxx\dashboard.component.ts(9,3)
      TS2345: Argument of type '{ components: { FullCalendar: { props: { header: {}; footer: {}; customButtons: {}; buttonIcons: {}; themeSystem: {}; bootstrapFontAwesome: {}; firstDay: {}; dir: {}; weekends: {}; hiddenDays: {}; fixedWeekCount: {}; ... 130 more ...; resourceRender: {}; }; ... 6 more ...; methods: { ...; }; }; }; }' is not assignable to parameter of type 'VueClass<Vue>'.
  Object literal may only specify known properties, but 'components' does not exist in type 'VueClass<Vue>'. Did you mean to write 'component'?
4

0 回答 0