npm install vue-awesome-swiper --save //基于vue使用的轮播组件
require('swiper/dist/css/swiper.css')
export default { data () { return { banners: [{ src: require('../img/1.jpg') }, { src: require('../img/4.jpg') }, { src: require('../img/5.jpg') }], swiperOption: { notNextTick: true, autoplay: 1000, pagination: '.swiper-pagination', paginationClickable: true, mousewheelControl: true, observeParents: true, onSlideChangeEnd: swiper => { this.page = swiper.realIndex + 1 this.index = swiper.realIndex } } } }, components: { swiper, swiperSlide }}