Vue类组件中的FullCalendar

时间:2019-08-02 22:01:46

标签: vuejs2 fullcalendar vue-class-components

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

FullCalendar documentation之后,我可以将其与提供的示例一起使用。 翻译成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'?

0 个答案:

没有答案