下载 使用 swiper
cnpm i swiper@3.4.2 --save-dev
main.js 中
import Swiper from 'swiper'
import 'swiper/dist/css/swiper.css'
vue swiper自定义分页器
var swiper = new Swiper(".feature", {
....
//前进后退后自动播放
//用户操作swiper之后,是否禁止 autoplay 。默认为true:停止。
autoplayDisableOnInteraction: false,
//分页器
pagination: ".swiper-pagin",
paginationClickable: true, //点击分页器 进行切换swiper
//以下 自定义分页器 类名默认 swiper-pagination-bullet ,
// active类名默认· swiper-pagination-bullet-active
paginationBulletRender: function (swiper, index, className) {
console.log(className); //默认类名 swiper-pagination-bullet
return '<div class="' + className + '"></div>';
},
});
css样式