轮播slider最后一个元素显示不全,能拖出来,松手弹回去
slidesPerView: ‘auto’,重要的属性设置,有的人说要给slider元素设置宽高,或者去掉所有的padding,但是slidesPerView: 'auto’设置过后会使轮播元素长度呈现一行无限滑动效果,最终在轮播初始化中设置固定宽度width,这个宽度要自己调试的,可能不是铺满。
const swiper = new Swiper('.swiper-container', {
slidesPerView: 'auto',
width: 1600,
pagination: {
el: '.swiper-pagination',
clickable: true
}
})