当我使用循环模式时,mySwiper.pagination.bullets未定义。 我怎么能得到它?
var swiperMain= new Swiper('.main__slider', {
slidesPerView: 1,
navigation: {nextEl: '.main__button-nav--next', prevEl: '.main__button-nav--prev'},
effect: 'fade',
autoplay: {
delay: 5000,
disableOnInteraction: false
},
loop: true,
pagination: {
el: '.main__menu--slider-nav',
clickable: true,
bulletActiveClass: 'active',
bulletClass: 'bullet',
renderBullet: function (index, className) {
return '<div class="menu__item--menu-slider ' + className +'"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><g fill="none" fill-rule="evenodd"><circle cx="15" cy="15" r="4" class="circle-center"/><circle cx="15" cy="15" r="14" class="circle-out"/><circle cx="15" cy="15" r="14" class="circle-line"/></g></svg><p>random</p></div>';
}
}
});
感谢。