Swiper 根据宽度响应式的显示不同的个数
var swiper = new Swiper('.swiper-container', {
slidesPerView: 1,
spaceBetween: 40,
breakpointsInverse: true,
breakpoints: {
//当宽度大于等于320
320: {
slidesPerView: 2,
spaceBetween: 10
},
//当宽度大于等于480
480: {
slidesPerView: 3,
spaceBetween: 20
},
//当宽度大于等于640
640: {
slidesPerView: 4,
spaceBetween: 30
}
}
})