<div class="zpfirst" @click="changeSwipe('up')">
<van-icon name="arrow-left"/>
</div>
<van-swipe class="swipeDiv" ref="swiper">
<van-swipe-item v-for="item in remakes" :key="item.id">
</van-swipe-item>
</van-swipe>
<div class="zplast" @click="changeSwipe('down')">
<van-icon name="arrow"/>
</div>
//点击左右按钮实现左右切换
changeSwipe(type) {
if(type == 'up') {
this.index -= 1;
} else if (type == 'down') {
this.index += 1;
}
this.$refs.swiper.swipeTo(this.index);
},
vant-swipe点击切换
最新推荐文章于 2024-01-30 16:25:25 发布