<scroll-view scroll-x class="scroll-header">
<view id="green" class="scroll-view-item bc_green"></view>
<view id="red" class="scroll-view-item bc_red"></view>
<view id="yellow" class="scroll-view-item bc_yellow"></view>
<view id="blue" class="scroll-view-item bc_blue"></view>
<view id="blue" class="scroll-view-item bc_blue"></view>
<view id="blue" class="scroll-view-item bc_blue"></view>
<view id="blue" class="scroll-view-item bc_blue"></view>
<view id="blue" class="scroll-view-item bc_blue"></view>
</scroll-view>
主要是css
.scroll-header{
display: flex;
white-space: nowrap; 这个很重要,
}
.scroll-header view{
height:128rpx;
128rpx;
border:1px solid red;
display: inline-block; 这个也很重要
}