<scroll-view scroll-x style="width: 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;
width: 200rpx;
height: auto;
white-space:normal !important; //解决文字不换行
}