微信小程序 swiper 组件坑

时间:2019-05-26 00:18:08   收藏:0   阅读:160

swiper 组件高度被限制为150px了,所以内容无法撑开。

 

解决办法

给这组件重新设置个高度,然后在把里面的图片设置为自动适应容器大小。图片模式设置为 宽度不变 自动适应高度

<swiper class="test" .....>
    <swiper-item>
        <image mode=‘widthFix‘ ...... />   
    </swiper-item>
</swiper>

<style>
.text{
  height:200px;
}
image{ width:100%; height:auto; } </style>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!