<scroll-view scroll-x style=" 100%;white-space: nowrap;overflow:hidden;"> <repeat for="{{msjtUrls}}" key="id" index="index" item="item"> <view class="items"> //item需要display:inline-block <image src='{{item.coursecover}}' class='img' lazy-load mode="widthFix"></image> <view class="coursetitle">{{item.coursetitle}}</view> </view> </repeat> </scroll-view>
.coursetitle{
display: inline-block;
font-size: 30rpx;
200rpx;
height: auto;
white-space:normal !important; //解决文字不换行
}