vue步骤条v-for处理最后一个
<div class="porewidth dis-inlineblock" :key="item.id" v-for="(item,i) in processList"><div>{{item.status}}</div><div v-if="item.status=='正常'"><divcl
·
<div class="porewidth dis-inlineblock" :key="item.id" v-for="(item,i) in processList">
<div>{{item.status}}</div>
<div v-if="item.status=='正常'">
<div class="radiobox success dis-inlineblock"></div>
<!-- 遍历处理最后一个值 -->
<div v-if="i===processList.length-1" class="dis-inlineblock"></div>
<div v-else class="dis-inlineblock linestyle"></div>
</div>
<div v-else-if="item.status=='异常'">
<div class="radiobox danger dis-inlineblock"></div>
<div v-if="i===processList.length-1" class="dis-inlineblock"></div>
<div v-else class="dis-inlineblock linestyle"></div>
</div>
<div>{{item.name}}</div>
</div>
processList:[
{
name:'活性炭',
status:'正常'
},
{
name:'加药间',
status:'异常'
},
{
name:'污泥脱水',
status:'异常'
},
{
name:'加药间',
status:'正常'
},
{
name:'加药间',
status:'正常'
},
{
name:'加药间',
status:'异常'
},
],
.radiobox{
width: 20px;
height: 20px;
border-radius: 10px;
}
.porewidth{
width: 15%;
}
.linestyle{
border-top: #000 2px solid;
width: 70%;
padding-bottom: 8%;
}
.danger{
background: red;
}
.success{
background: rgb(10, 112, 228);
}
更多推荐
已为社区贡献3条内容
所有评论(0)