function play(){
if (mySwiper !== 0) {
mySwiper.destroy();
}
mySwiper = new Swiper(‘.swiper-container‘, {
observer: true,
observeParents: true,
// direction: ‘vertical‘, // 垂直切换选项
loop: true, // 循环模式选项
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: false,
},
pagination: {
el: ‘.swiper-pagination‘,
clickable: true
},
// 如果需要前进后退按钮
navigation: {
nextEl: ‘.next‘,
prevEl: ‘.prev‘
},
})
}