时间:2019-05-07 来源:小程序工厂
***:
图片模式用 mode="aspectFill" 不就好了吗?
***:
轮播图从来都没有自适应这种说法 我传一张16:9 和 9:16的图你来给我自适应?只有垃圾产品才会想到这些东西
数据绑定能否提供一次绑定的功能,微信小程序开发教程
小***: < swiper wx:for='{{array}}' style = 'height:{{ heights[index] || 50 }}px' > < swiper-item > < view class = 'getThisHeight' > ...这里放自适应内容 view > swiper-item > swiper >
justifyHeight: function () { let that = this let hs = [] wx.createSelectorQuery().selectAll( '. getThisHeight ' ).boundingClientRect( function (rects) { rects.forEach((v, i) => { hs[i] = v.height }) that.setData({ heights: hs, }) }).exec() },
D***:
在使用mode=widthFix的情况下,再添加一个width:100%; 就可以了