I have a function that returns an array of objects like this:
getMonthDaysGrid() {
const totalLastMonthDays = this.getFirstDayOfMonth().dayNumber;
const totalDays = this.month.numberOfDays + totalLastMonthDays;
const monthList = Array.from({ length: totalDays });
for (let i = totalLastMonthDays; i < totalDays; i++) {
monthList[i] = {
date: i - totalLastMonthDays + 1,
month: this.month.name,
year: this.month.year,
};
}
return monthList;
}
when I try to make a v-for div like this:
<div v-for="(day, idx) in cal.getMonthDaysGrid()" :key="idx">
<p>
{{ day.date }}
</p>
</div>
this throw me this error:
I can't figure how to fix it... if it loops the array, how is that I can't access the object properties?

0, which probably never gets filled.