swiper 动态设置indicator-dots为false无效
发布于 7 年前 作者 jing98 9383 次浏览 来自 问答

swiper 动态设置indicator-dots为false无效

<!--幻灯片-->
     <template is="swiper" data="{{list:banner_list,indicatorDots:'false'}}" />
<!--幻灯片-->
<template name="swiper">
  <block wx:if="{{list && list.length>0}}">
    <view class="page__swiper">
      <swiper indicator-dots="{{indicatorDots?indicatorDots:'true'}}" indicator-color="{{indicatorColor?indicatorColor:''}}" indicator-active-color="{{indicatorActiveColor?indicatorActiveColor:'#2395ff'}}" autoplay="{{autoplay?autoplay:'true'}}" current="{{current?current:0}}" interval="{{interval?interval:5000}}" duration="{{duration?duration:1000}}" circular="{{circular?circular:false}}"  vertical="{{vertical?vertical:false}}" bindchange="swiperChange">
        <block wx:for="{{list}}" wx:key="value">
          <swiper-item>
            <block wx:if="{{item.linkurl}}">
              <navigator url="{{item.linkurl}}" hover-class="weui-cell_active">
                <image src="{{item.image_path}}" class="slide-image" width="100%" height="100%" />
              </navigator>
            </block>
            <block wx:else>
              <image src="{{item.image_path}}" class="slide-image" width="100%" height="100%" />
            </block>
          </swiper-item>
        </block>
      </swiper>
    </view>
  </block>
</template>

indicator-dots=“true” 或indicator-dots=“false” 要删除了圆点才会隐藏,设置为false也无效

1 回复

<swiper indicator-dots=‘false’ indicator-color=‘rgba(0, 0, 0, 0)’ indicator-active-color=‘rgba(0, 0, 0, 0)’

我是这么解决的

回到顶部