第一步:
npm install swiper vue-awesome-swiper --save
第二步:
在项目中main.js中加入
import Vue from ‘vue’
import VueAwesomeSwiper from ‘vue-awesome-swiper’
import ‘swiper/dist/css/swiper.min.css’
import ‘swiper/dist/js/swiper.min’
Vue.config.productionTip = false
Vue.use(VueAwesomeSwiper)
第三步:
在需要些代码的地方
<template>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide"