想单独删除某个元素,为什么每次向左滑动 整个UI列表都暴露出删除按钮<ul>
<transition-group name="slide-fade">
<li v-for = '(food,index) in selectFoods' class="cartList slide-warp" :key="food.name" ref="slideWarp">
<div style="float: left;" class="slide-item" :data-index="index">{{food.name}}</div>
<div class="cartControl">
<span @click = "addFood(food)" class="addFood">+</span>
<b>{{food.count}}</b>
<span @click = 'decreaseFood(food)' class="decreaseFood">-</span>
<span>价格:¥{{food.count * food.price}}</span>
</div>
<div class="slide-del">删除</div>
</li>
</transition-group>
</ul>
添加回答
举报
0/150
提交
取消