I have an e-commerce site, I want to loop the nested data from json. I tried many things but couldn't find.
async fetch() {
this.post = await fetch(
`http://test.com/api.php?id=${this.$route.params.id}`
).then((res) => res.json())
}
I use like this;
<h3>{{ post.title }}</h3>
<li v-for="(index, post.sizes) in sizes" :key="index">
{{ sizes.index }}
</li>
My json Data is : "sizes": "[\"XS\",\"S\",\"M\",\"L\"]",
thanks for helping.
v-for="(index, size) in post.sizes"and then access{{ size }}. Also if this does not help then can you share the whole component how you are using it and also the whole jsonData structure.<li v-for="(size, index) in sizes" :key="index"> {{ size }}</li>