用这个方式:留意当中的 斜粗体,添加这几项即可
<scroll-view scroll-x style=“width:100%;height: 100px;overflow:scroll;white-space:nowrap”>
<view class=“itemcont” catchtap=“onsetTap” data-setdetailid="{{setdetailId}}" data-imgsrc="{{setImg}}" hover hover-class=“view-item-hover”>
<view class=“itemtitle”>{{setName}}</view>
<image src="{{setImgsm}}" class=“itemimg” mode=“widthFix”/>
</view>
</scroll-view>
c s s:
.itemcont{
width: 160rpx;
height: 160rpx;
overflow: hidden;
border-radius: 4px;
margin: 3px 5px;
border: 2px solid #eee;
position: relative;
display: inline-block;
}