I have this for loop to get all the images of a post but I only want to show the first image not all of them. How do I go about doing that please:
This gives me post.images is undefined:
<tr v-for="(post, id) in posts" :key="id">
<div class="postBody">
{{ post.body }}
</div>
<div class="postImages flex">
<div
class="postImage"
v-for="(img, id) in post.images.slice(0,1)"
:key="id"
>
<img class="postImg" :src="img.image" />
</div>
</div>
</tr>