微信小程序幻燈片簡單代碼

6,994 views

wxml

<view class=”haibao”>
<swiperindicator-dots=”{{indicatorDots}}”autoplay=”{{autoplay}}”interval=”{{interval}}”duration=”{{duration}}”style=”height:80px;”>
<blockwx:for=”{{imgUrls}}”>
<swiper-item>
<imagesrc=”{{item}}”style=”width:100%;height:80px;”></image>
</swiper-item>
</block>
</swiper>
</view>

JS

indicatorDots:false,
autoplay:true,
interval:5000,
duration:1000,
imgUrls:[
‘/images/haibao/1.jpg’,
‘/images/haibao/2.jpg’,
‘/images/haibao/3.jpg’
],

 

 

如果您覺得這篇文章對您有幫助,歡迎繼續關注本站!!!我要贊助本站>>>

Leave a Reply

電子郵件地址不會被公開。 必填項已用*標注