vue自定义轮播图组件|vue自定义轮播图组件 swiper

1.banner 组件
components/Banner.vue

.swiper-container { width: 100%; height: 200px; .swiper-wrapper { width: 100%; height: 100%; } .swiper-slide { background-position: center; background-size: cover; width: 100%; height: 100%; img { width: 100%; height: 100%; } } }

2.swiper 组件
components/Swiper.vue
.swiper-container { width: 100%; height: 200px; margin-top: 10px; .swiper-wrapper { width: 100%; height: 100%; .swiper-slide { background-size: cover; width: 100%; height: 200px; img { width: 100%; height: 100%; } } } }

3.页面调用
//

4.效果图
【vue自定义轮播图组件|vue自定义轮播图组件 swiper】vue自定义轮播图组件|vue自定义轮播图组件 swiper
文章图片

    推荐阅读