How Can I Looping For with items inside


<tr v-for="(items, index) in cart" :key="items.id">
    <td>{{ index + 1 }}</td>
    <td v-for="(item, index) in items.cart_items" :key="index"><img :src="item.product.image" alt="" srcset="" class="img-fluid" width="200px"></td>
    <td v-for="(item, index) in items.cart_items" :key="index">{{ item.product.name }}</td>
</tr>

In the above code, you are using the same index as a key for two td elements which is not a good approach.

Key-value should be always unique for each element rendered.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top