wxml页面
interval :图片跳转的时间间隔
autoplay:自动切换图片
indicator-dots:图片下方的小圆点
<swiper indicator-dots=‘true‘ autoplay=‘true‘ interval=‘5000‘ vertical="{{false}}"> <swiper-item> <image src="/images/post/post-1@text.jpg"></image> </swiper-item> <swiper-item> <image src="/images/post/post-2@text.jpg"></image> </swiper-item> <swiper-item> <image src="/images/post/post-3@text.jpg"></image> </swiper-item> </swiper>
wxss页面
swiper{ width: 100%; height: 600rpx; } swiper image{ width: 100%; height: 600rpx; }
效果图: