0π
I donβt know if I understood you properly, but this is my suggestion:
//div in v-fored td
:class="dynamicClass(dayDate)"
// script
computed: {
dynamicClass () {
return (day) => {
let event = this.events.find(ev => ev.event_date === day);
return event.user_id !== 0 ? 'event_selected':'event_free'
}
}
}
0π
the solution was to add a condition that the typeof my object should not be undefined and iused the idea in the answer of Eggon
Source:stackexchange.com