美文网首页
vue -for循环 对某一项增加class

vue -for循环 对某一项增加class

作者: undefined汪少 | 来源:发表于2019-07-31 10:42 被阅读0次

div部分

<Col v-for="(item,index) initems" span="2" class="map_class" :class="{'mapkey':(index == 6)}">

  <p style="font-size: 20px">{{item.name}}

  <p style="color: #4c4c4c">{{item.age}}

</Col>

css部分

.mapkey{

text-align:center;

  width:90px;

  height:50px;

  background:#f0c9ce;

  margin:10px;

  color:#e64758;

  font-weight:bold;

}

相关文章

网友评论

      本文标题:vue -for循环 对某一项增加class

      本文链接:https://www.haomeiwen.com/subject/tahzrctx.html