export default {
name: '',
data () {
return {
swiperOption: {
direction: 'vertical',
slidesPerView: 1,
spaceBetween: 30,
mousewheel: true,
lazyLoading : true,
onSlideChangeEnd: swiper => {
this.page = swiper.realIndex + 1
this.index = swiper.realIndex
alert(123)
},
fade:{crossFade:true},
pagination: {
el: '.swiper-pagination',
clickable: true
}
},
pathName:this.$route.name
}
},
components: {
swiper,
swiperSlide,
one,
two,
three
},
computed: {
swiper () {
return this.$refs.mySwiper.swiper
},
change (swiper){
console.log(swiper)
}
},
// 测试
methods:{
//点击跳到对应的index页面
changeIndex(index){
console.log(this.$refs.mySwiper.swiper)
this.$refs.mySwiper.swiper.slideTo(index, 1000, true);//切换到第一个slide,速度为1秒
}
}
}
版权声明:本文为weixin_39818631原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。