swiper 图片无法填充? 新手求助
想让图片铺满整个swiper区域 ,但是右边一直留了空白,想请教各位大佬如何解决?
显示效果如图:
home.wxml:
<!--幻灯片 开始-->
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{background}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" mode="scaleToFill"></image>
</swiper-item>
</block>
</swiper>
<!--幻灯片 结束-->
home.wxss:
.swiper-box{
padding: 3rpx;
}
.swiper-box swiper{
height: 320rpx;
}
.swiper-box swiper image {
width: auto;
height: auto;
}
home.js:
background: ['/images/幻灯片test1.png', '/images/幻灯片test2.png', '/images/幻灯片test3.png','/images/幻灯片test4.png','/images/幻灯片test5.png'],
circular: true,
indicatorDots: true,
indicatorcolor: "#000",
vertical: false,
autoplay: true,
interval: 2500,
duration: 100,