<div class="swiper-pagination" slot="pagination"></div>
//这个上面加一个 slot="pagination"
new Swiper('.swiper-container', {
loop: true,
// 如果需要分页器
pagination:{
el:'.swiper-pagination',
clickable:true,
},//这样写小圆点就有了
// 如果需要前进后退按钮
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
// 如果需要滚动条
scrollbar: '.swiper-scrollbar',
})
转载于:https://juejin.im/post/5cac6ce1f265da03a630b728