data() {
return {
swiperOption: {
speed: 1000,
keyboard : true,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
loop:true,
onSlideChangeStart: swiper => {
//这个位置放swiper的回调方法
alert(11)
},
on: {
init: function(){
//Swiper初始化了
alert('当前的slide序号是'+this.activeIndex);
}
}
// some swiper options/callbacks
// 所有的参数同 swiper 官方 api 参数
// ...
}
}
},
init可以触发,但是onSlideChangeStart怎么也不触发
应该把slideChange方法放在on里
如下