Im using the v-calendar and in the attributes, I want to map through api data. My code is as follows and I used https://vcalendar.io/attributes.html for reference.
computed: {
attributes() {
return [
{
key: 'today',
dates: new Date()
},
...this.$store.getters['resource/list']('actionEvents').map(attr => ({
dates: attr.dates,
key: 'range',
dot: {
color: attr.color,
},
popover: {
label: attr.description,
},
customData: { calendarData : attr },
})),
];
},
<popover-row
v-for="attr in attributes"
:key="attr.key"
:attribute="attr">
{{ attr.customData && attrr.customData.calendarData &&
attr.customData.calendarData.description }}
</popover-row>
I get the following error:
Cannot read properties of null (reading ‘map’)
Does this mean that I’m trying to map something that isn’t an array? Is there a way to rewrite the code so i dont get this error?