[Vuejs]-V-for Array Object

0👍

Axios returns a proxy of the object, then when you go through it you need an index, then I have solved it by equalizing,

links = res.data ==> Now links=res.data.links 

now this works with v-for without problems.

-1👍

Have you tried:

<ul>
  <li v-for="(data,index) in userStore.links">{{data[index].link}} - {{index}}</li>
</ul>

That way if userStore.links is an array, it will iterate through all items.

https://vuejs.org/guide/essentials/list.html#v-for-with-an-object

Leave a comment