<view wx:for="{{one}}" style="display:inline-block;width:100rpx;margin-left:20rpx;">{{item}} </view>
</scroll-view>
條件:
1.在scroll-view標籤使用nowrap;目的:當scroll-view裏邊的內容太長時,保證在一行內容納,之前誤區是我看到容器內長度太長時會自動換行,就給scroll-view設置了width,結果底下的也會滾動。
2.容器內項使用display:inline-block
3.scroll-view標籤使用scroll-x=‘true’