Hello,
Recently, I put online my app with the lite calendar. One of my client reported me a bug where events don't show on the calendar sometimes.
I tried myself with his account and i saw in logs that TypeError: Cannot read properties of undefined (reading 'update').
It never happened to me before so I don't really understand why ?
Here is an example of my code :
Vue :
<DayPilotCalendar id="dp" :config="config" ref="calendar" />
Typescript :
computed: {
calendar() {
return this.$refs.calendar?.control;
}
},
data() {
return {
events : [],
}
},
async created() {
// code for something else
this.loadEvents();
}
},
methods : {
async loadEvents() {
await this.getAllRequest().then(res => {
// placeholder for an HTTP call
const events = this.events;
this.calendar.update({ events });
})
},
async getAllRequest() {
this.events = [];
await this.backend.getAllRequest().then(async res => {
// code for data
})
},
},
I hope this help !
Thanks in advance !