Use Swiper components in VUE

The first step: download and install swiper in the project root directory of the terminal:

cnpm/npm install vue-awesome-swiper –save;

Step 2: In the program entry file main. Reference in js:

import VueAwesomeSwiper from’vue-awesome-swiper’

import’swiper/dist/css/swiper.css’;

Step 3: In Swiper component used in main.js:

Vue.use(VueAwesomeSwiper)

Partial quote:

import’swiper/dist/css/swiper.css’

import {swiper, swiperSlide} from’vue-awesome-swiper’

Export two components:

components: {

  Swiper,

  SwiperSlide

}

components: {

  Swiper,

  SwiperSlide

}

Leave a Comment

Your email address will not be published.