使用swiper设置轮播图,下面是实现效果图
页面结构
<swiper class="content-info-slide" indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff" indicator-dots circular autoplay> <swiper-item> <image src="/pages/images/test.png" /> </swiper-item> <swiper-item> <image src="/pages/images/1.png" /> </swiper-item> <swiper-item> <image src="/pages/images/2.png" /> </swiper-item> </swiper>
css样式
.content-info-slide{ height: 302rpx; margin-bottom: 20px; } .content-info-slide image{ width: 100%; height: 100%; }
将图片的宽高都设置为100%占满设置的区域
标签:info,轮播,微信,100%,height,content,----- From: https://www.cnblogs.com/lixianhui/p/18149143