标签:lis script current -o for循环 for v-for OLE lex
1:html
<div class="bd7 flex-row">
<span class="word3 flex-col" v-for="(item, index) in datalist" :class="currentClass(index)" v-on:click="jgClick(item.num,index)">{{item.num}}元</span>
</div>
2:script
data: {
isActived: 0
}
jgClick: function (num,index) {
this.total = num
this.isActived = index
},
currentClass: function (index) {
console.log(index)
return this.isActived == index ? ‘active‘ : ‘‘;
}
标签:lis script current -o for循环 for v-for OLE lex
原文地址:https://www.cnblogs.com/gumuchenglin/p/14818857.html