1、下载插件
npm install --save vue-awesome-swiper
2、引入
1.全局引入
在 main.js 里引入(全局):
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)
import 'swiper/dist/css/swiper.css'
2.局部引入
<script>
import 'swiper/css/swiper.css'
import {
Swiper, SwiperSlide } from 'vue-awesome-swiper'
export default {
component: {
Swiper,
SwiperSlide
}
}
</script>
3、配置
参考swiper官网:https://www.swiper.com.cn/api/index.html
1.template
<swiper class="bannerSwiper" :options