The rotation chart of small programs

Today, I record how to achieve the effect of the rotation chart when developing the small program. Not much to say, go directly to the code:

<!-- 1. Home Rotary Map -->
    <swiper class="my-swiper" 
        <block wx:for="{{imgUrls}}">
          <swiper-item class="sw-img">
              <image src="{{item}}" mode="widthFix"></image>

Rotation, using swiper components, there are many attributes, generally the following are more commonly used:

  • autoplay="true": Set autoplay
  • indicator-dots="true": Whether the panel pointer is displayed or not
  • indicator-active-color="#fff": the current selected indicator color
  • circular="true": whether to use cohesive sliding
  • Interval: automatic switching interval, default 5000ms

Data in js:

  data: {
    imgUrls: ["",

Keywords: Mobile

Added by nomadrw on Sun, 06 Oct 2019 11:43:46 +0300