vant-swipe点击切换

<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)