[Vuejs]-VueJs Loop child

0👍

You can loop through object using (value, key) (document)

<div v-for="(key, list) in collections">
  <div> {{ list[0].label }}</div>
  <div v-for="item in list">
    <div>{{item.name}}</div>
  </div>
</div>

or a better way

<div v-for="(key, list) in collections" :key="key">
  <div v-for="(item, index) in list" :key="index">
    <div v-if="index === 0"> {{ item.label }}</div>
    <div>{{item.name}}</div>
  </div>
</div>

Leave a comment