template中:
<view class="pop-item2" v-for="(item,index) in popList" :key="index" >
<view class="pop-item2-2" v-bind:class="{changeColor:index%2==0,changeWidth:index%2==1}">
<text>{{item.title1}}</text>
<text>{{item.title2}}</text>
</view>
</view>
style 中:
.changeColor{
background-color: #CCCCCC;
}
.changeWidth{
background-color: #7BABFF;
}