NuxtN
Nuxt16mo ago
cesarecluka

Problem with v-for, array undefined

I have spent hours on this issue and I can not get it solved whatever I try. I am fetching Graphql data with Nuxt-Apollo and the data is getting fetched fine, able to console.log it and even print it out raw in the template with the handle bars. However, when trying to iterate through the data in v-for I am getting "Cannot read properties of undefined (reading '0')".

I have tried all kinds of await/then combinations, I have tried with putting v-if on the element and tying it to length directly or over a computed property and nothing seems to work. The data is obviously available in the template as the v-if passes as true, but in v-for it is undefined. This seems like a really simple issue and I assume the solution is as well, but I just can't see what I am doing wrong.
Capture_2.JPG
Capture.JPG
Was this page helpful?