接收半路项目,有个需求点击下面的轮播缩略图,控制上面轮播图滑动位置
<swiper :options="swiperOption1" ref="mySwiper" class="swiper-container">
<swiper-slide v-for="(item,index) in dialogData" :key="index">
<div class="banner-in">
<img :src="item.src" alt="">
</div>
</swiper-slide>
</swiper>
<swiper :options="swiperOption2" ref="mySwiper3" class="swiper-container2 gallery-thumbs">
<swiper-slide class="banner-in" v-for="(item,index) in dialogData" :key="index" >
<img :src="item.src" alt="" @click="handleBannerIn(item,index)">
</swiper-slide>
</swiper>
methods:{
/**
* 下面轮播控制上面的缩略大图滑动位置
*/
handleBannerIn(item,index){ // 参数只需要传递index 就可以了,懒得改了
this.$refs.mySwiper.swiper.slideTo(index, 600, false)
},
}