WeChat Mini Programs uses the swiper broadcast picture, how to judge that when the fourth picture is taken, a button appears at the bottom of the broadcast picture.

problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

    <swiper indicator-dots="{{indicatorDots}}" current="{{current}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
        <block wx:for="{{imgUrls}}"  wx:for-index="index">
          <swiper-item>
            <image src="{{item.url}}" class="slide-image" />
          </swiper-item>
        </block>
    </swiper>

what result do you expect? What is the error message actually seen?


bindchange . Add this event to the swiper component. When triggered, the index to which you are currently scrolling will be returned, and the button will be set to display

when it is judged to be the fourth.

Mini Program swiper component

Menu