swiper默认最小高度150 要求:swiper高度自适应 wxml <view class='swiper'> <swiper indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" autoplay="{{autoplay}}" duration="{{duration}}" interval='{{interval}}' bindchange="bindchange" circular="{{circular}}" style="height:{{imgheights[current]}}rpx;"> <block wx:for='{{imgList}}' wx:key="{{index}}"> <swiper-item> <image src="{{item}}" data-id='{{index}}' class="slide-image" mode="widthFix" bindload="imageLoad"/> </swiper-item> </block> </swiper> </view> wxss .swiper image { width: 100%; height: auto; } wxjs data: { //图片地址 imgList: ['/images/wyh-img_bg.png', '/images/wyh-img8.png', '/images/wyh-img_shop1.png', '/images/wyh-img_bg1.png'], //是否采用衔接滑动 circular: true, //是否显示画板指示点 indicatorDots: false, //选中点的颜色 indicatorcolor: "#000", //是否竖直 vertical: false, //是否自动切换 autoplay: true, //自动切换的间隔 interval: 2500, //滑动动画时长毫秒 duration: 100, |
温馨提示:这篇文章没有解决您的问题?欢迎添加微信:18948083295,有微信小程序专业人员,保证有问必答。转载本站文章请注明转自http://www.okeydown.com/(微信小程序网)。
- 微信扫描二维码关注官方微信
- ▲长按图片识别二维码