微信小程序 滑块 swiper 轮播

微信小程序 滑块 swiper 轮播

index.wxml

<view>
  <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
    <block wx:for="{{imgUrls}}">
      <swiper-item>
        <image src="{{item}}"></image>
      </swiper-item>
    </block>
  </swiper>
</view>

index.js

Page({
  data: {
    indicatorDots: true,
    autoplay: true,
    interval: 3000,
    duration: 1000,
    imgUrls: [
      "../../images/1.png",
      "../../images/2.png",
      "../../images/3.png"
    ]
  }

}

发表回复

您的电子邮箱地址不会被公开。