若组件内的内容都通过wx:for渲染的,则初始化的scroll-left无效。
<scroll-view class=“items” scroll-x=“true” style=“width:100%” scroll-left=“305”>
<view class=“row”>
<view wx:for="{{array}}">{{item}}</view>
</view>
</scroll-view>
若内容都是静态初始化,则scroll-left有效
<scroll-view class=“items” scroll-x=“true” style=“width:100%” scroll-left=“305”>
<view class=“row”>
<view>1</view>
<view>2</view>
<view>3</view>
…
</view>
</scroll-view>