[Vuejs]-Loop variable in v-for is undefined

0👍

Found it.

The parent component (A) needs to load the measurement info from a REST server; the component with the error (B) was initialised too early, before the data was available. A set B’s properties with a computed property that is an empty array until the server response is received. I do not know why Vue enters the loop at all, but preventing B’s loading with a v-if until the server response is there solved the problem.

Leave a comment