v-for循环中嵌套数组
用来写循环卡片中的标签
<view class="stray-dog con" v-for="(item, index) in strayDogList" @click="goPage(item.url)">
<view class="strayDogImg">
<image :src="item.image" mode="aspectFill"></image>
</view>
<view class="strayDogIntroduce">
<!-- 名字 -->
<view class="strayDogName">{ { item.name}}</view>
<!-- 基本情况 -->
<text class="introduceText">{ { item.text}}</text>
<!-- 标签 -->
<view class="strayDogLable">
<view class="dogLable" v-for="itemTags in item.tags" :key ="itemTags">{ { itemTags}}</view>
</view>
</view>
</view>
strayDogList循环中的数据
{
image:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3206107408,69292545&fm=26&gp=0.jpg',
name:'丁丁,1个月',
text:'地铁口捡到的,打过疫苗,已经跟了自己一段时间,一直未找到主人,希望有爱心人士领养',
tags:['已免疫','未驱虫','未绝育']
},
还没有评论,来说两句吧...