1. 程式人生 > >微信小程式 翻頁效果

微信小程式 翻頁效果

.wxml

<swiper indicator-dots="YES"
  autoplay="YES" interval="5000" duration="500" circular = "YES">
  <block wx:for="{{banner}}">
    <swiper-item>
      <image src="{{item.bannerimg}}" class="slide-image" width="100%" />
    </swiper-item>
  </block>
</swiper>

.js

Page({  
    data: {  
        banner: [],  
    },  
    onLoad: function () {  
        console.log('onLoad')  
        var that = this  
        that.setData({  
            banner: /***設定list資料***/,  
                });