1、github中搜索swiper 参考网址 https://github.com/surmon-china/vue-awesome-swiper
2、按照步骤进行操作 安装
npm install vue-awesome-swiper --save
3、在main.js中引入
import VueAwesomeSwiper from 'vue-awesome-swiper'
// require styles
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper, /* { default global options } */)
4、安装完成进行测试
<!-- The ref attr used to find the swiper instance -->
<template class="swipers">
<swiper :options="swiperOption" ref="mySwiper" @someSwiperEvent="callback">
<!-- slides 静态写法-->
<swiper-slide>I'm Slide 1</swiper-slide>
<swiper-slide>I'm Slide 2