使用微信小程序内置组件swiper实现轮播图

swiper style="height:400rpx" indicator-dots=true  autoplay=true interval=2000 duration=500 circular=true  block wx:for="{{imgUrls}}"    swiper-item      image src="{{item}}" class="slide-image" style="width:740rpx;height:400rpx"/    /swiper-item  /block/swiperdata = {  imgUrls:[    '../assets/img/tab/1.jpg',    '../assets/img/tab/2.jpg',    '../assets/img/tab/3.jpg',    '../assets/img/tab/4.jpg',    '../assets/img/tab/5.jpg'  ]}

效果图
小程序
小程序

swiper参数

 属性名  类型  默认值  说明  最低版本                                                                                                    
indicator-dotsBooleanfalse是否显示面板指示点
indicator-colorColorrgba(0, 0, 0, .3)指示点颜色1.1.0
indicator-active-colorColor000000当前选中的指示点颜色1.1.0
autoplayBooleanfalse是否自动切换
currentNumber0当前所在页面的 index
intervalNumber5000自动切换时间间隔
durationNumber500滑动动画时长
circularBooleanfalse是否采用衔接滑动
verticalBooleanfalse滑动方向是否为纵向
bindchangeEventHandlecurrent改变时会触发 change 事件,event.detail = {current: current, source: source}

TAG标签: 微信小程序小程序轮播图

http://www.xiaochengxub.com/read-103894.html