vue 可复用swiper以及scoped样式穿透(可以不受scoped的限制来修改样式)

参考: https://blog.csdn.net/dwb123456123456/article/details/82701740
https://blog.csdn.net/u014027876/article/details/81663080
https://www.jianshu.com/p/8601ccf91225

  1. 安装

npm install  vue-awesome-swiper

cnpm inatall vue-awesome-swiper

  1. main.js中引入

import vueSwiper from 'vue-awesome-swiper'

  1. component - ShopSlide.vue 中引入

import { swiper, swiperSlider } from 'vue-awesome-swiper'

import 'swiper/dist/css/swiper.css'

components: {

swiper,

swiperSlider

}

  1. ShopSlide.vue代码







  1. 其他组件内引用ShopSlide.vue




                    
                    

你可能感兴趣的:(vue 可复用swiper以及scoped样式穿透(可以不受scoped的限制来修改样式))