Struggling to integrate FullCalendar-vue with Typescript, I encountered a problem when trying to access its API.
This is how my calendar is set up:
<FullCalendar ref="fullCalendar" :options="calendarOptions" style="width: 100%" />
To make the API accessible throughout my component, I created a computed property:
computed: {
calendar() {
return this.$refs.fullCalendar.getApi() // Error: Property 'getApi' does not exist on type 'Vue | Element | Vue[] | Element[]'.
},
}
The error message says:
Error: Property 'getApi' does not exist on type 'Vue | Element | Vue[] | Element[]'.
I'm unsure how to inform VS Code that this.$refs.fullCalendar
should be recognized as a Calendar
instance.