<view class="orders-start-view">
//单个对象形式
//有多个以,号隔开
//例如:{'active-order-start':currentIndex==0,'stoy'}
<view :class="{'active-order-start':currentIndex==0}"
@click="swicthState(0)">
全部
</view>
//单个数组形式
<view :class="[currentIndex==1 && 'active-order-start']"
@click="swicthState(1)">
待支付
</view>
<view :class="[currentIndex==2 && 'active-order-start']"
@click="swicthState(2)">
待配送
</view>
//单个数组形式2
//多个数组形式以逗号隔开
//例如:[{'active-order-start':currentIndex==3},'stoy']
<view :class="[{'active-order-start':currentIndex==3}]"
@click="swicthState(3)">
配送中
</view>
<view :class="[currentIndex==4 && 'active-order-start']"
@click="swicthState(4)">
待评价
</view>
</view>
VUE之动态绑定class
最新推荐文章于 2025-06-11 19:50:48 发布