多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 1.在index.wxml中添加以下代码 ``` <view> <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> <block wx:for="{{imgUrl}}" wx:key="index"> <swiper-item> <image src="{{item.url}}" class="slide-image" /> </swiper-item> </block> </swiper> </view> ``` # 2.在index.js中添加以下代码 ``` Page({ data: { imgUrl: [ { url: "/images/post/cat.png" },//获取本地图片 { url: "/images/post/crab.png" }, { url: "/images/post/sls.png" }, ], indicatorDots: false, autoplay: false, interval: 5000, duration: 1000 }, }) ```