Skip to content
Advertisement

how to properly format a v-for loop for multi-level array

I’m learning how the v-for loops work in Vue. Really liking the idea that I can run the loop directly in my template HTML but unsure how to properly use the v-for loop to delve into a multi level array.

I have variable called playerDataList it contains some JSON data. A sample of which is below

JavaScript

I’ve got this code so far, and it works to display my content, but it’s only pulling me the first instance. It’s not actually looping and giving me each occurrence.

JavaScript

Is there anything I could do differently to get this properly looping?

Advertisement

Answer

You need to loop the inner properties of stat. It is not an array.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement