小程序banner图展示

tech2025-07-30  5

wxml文件

<swiper class='u-wrp-bnr' indicator-dots='true' autoplay='true' interval='5000' duration='1000' circular='true'> <block wx:for="{{banner}}" wx:for-index="index" wx:key="key"> <swiper-item> <image src='{{item.pic}}' class='u-img-slide' mode='aspectFill'></image> </swiper-item> </block> </swiper>

wxss文件

.u-wrp-bnr { width: 100%; height: 360rpx; display: block; position: relative; background: #f0f0f0; } .u-img-slide { width: 100%; height: inherit; }

 

最新回复(0)