小程序scroll-view横向滚动
<view style="width: 100%;height: 100rpx;white-space:nowrap;">
<scroll-view scroll-x>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
<view style="width: 100rpx;display:inline-block">文章</view>
</scroll-view>
</view>
记得需要在父元素上设置white-space:nowrap;
胖胖熊笔记,笔记已迁移

浙公网安备 33010602011771号