width: fit-content 部分机型不能正常使用(iPhone 5S, iOS 10.3.3)
效果图如下
iPhone 5S: https://ws2.sinaimg.cn/large/006tNc79ly1fostfmm11pj30gy0u0abs.jpg
其他: https://ws3.sinaimg.cn/large/006tNc79ly1fostf0n45pj30gy0u0abs.jpg
<view class="indicator-container" wx:if="{{imageLength > 1}}"> <view class="indicators"> <block wx:for="{{images}}" wx:key="index"> <view class="indicator {{(currentIndex === index)?'active':''}} {{(index !== 0)?'margin-left-enable':''}}"></view> </block> <view style="clear: both"></view> </view> </view> |
.indicator-container { position: absolute; bottom: 35rpx; width: 100%; height: 10rpx; } .indicators { width: fit-content; margin: auto; } .indicator { float: left; height: 10rpx; width: 10rpx; background-color: rgb(230, 230, 230); } .active { background-color: black; width: 38rpx; } .margin-left-enable { margin-left: 22rpx; } |

添加box-sizing: content-box;虽然这个属性是默认属性,但是上面的那个机型,只有加了这个属性width: fit-content;属性就会生效
fit-content 对于ios部分机型本身就有兼容性问题。经测在iPhone 11机器上也会表现出来。跟微信内核、小程序基础库没有关系。
请问有人没,急求