//隔行变色关键:class="index % 2 === 0 ? 'even' : 'odd'"
<view class="content_box2" v-for="(item,index) in list" :key="item.id"
:class="index % 2 === 0 ? 'even' : 'odd'">
<div style="width: 27.5%;">{{item.type}}</div>
<div style="width: 27.5%;">{{item.weigth}}</div>
<div style="width: 27.5%;">{{item.price}}</div>
<div style="width: 17.5%;">{{item.averagePrice}}</div>
</view>
.even {
background-color: #f2f2f2;
}
.odd {
background-color: #ffffff;
}