<swiper class="swiper" :display-multiple-items="multipleItems">
<swiper-item v-for="(item,index) in vipList" :key="index" :item-id="">
<view class="vip-card-mini" @click="changeVip(index, item)":style="{'margin-right':index== -1?'20rpx':'0','border':index === selectedIndex?'1px solid #cfa16c':'none','min-width':greaterThan?'28%':'30%'}">
<view class="flex-between">
<view style="color:#7d5723 ;font-size: 12px;font-weight: 600;">{{}}</view>
<view style="color: #905723;font-size: 10px;margin-right: 8rpx;text-align: right;">普通VIP
</view>
</view>
<view class="flex-between-center">
<view class="amount">¥{{}}</view>
<view class="vip-img"><image src="/static/" style="width: 20px;height: 20px;"></image></view></view>
</view>
</swiper-item>
<view v-if="multipleItems==3">
//必写 不然会报错
<swiper-item v-if="<multipleItems"></swiper-item>
<swiper-item v-if="<multipleItems-1"></swiper-item>
</view>
</swiper>
<script>
export default {
data() {
return {
// vipList数组长度 因为这个功能需求是要展示三个卡片 如果不动态写multipleItems控制台<swiper-item>数量相关错误信息
multipleItems:3,
}
}
}
</script>