Skip to content

SwiperDot 轮播图指示点 ​

包装轮播内容并显示圆点、数字或标题指示器。页面需自行通过 current 同步轮播索引。

支持平台 ​

以下为官网文档所列的平台支持情况,具体功能及版本限制请参见本页的平台说明。

App-vueApp-nvue微信小程序支付宝小程序百度小程序字节小程序QQ小程序H5PC快手小程序钉钉小程序
✓✓✓✓✓✓✓✓✓✓✓

基础用法 ​

vue
<!-- 当前索引由页面轮播事件更新 -->
<fui-swiper-dot :items="slides" :current="current">
  <swiper :current="current" @change="handleSwiperChange">
    <swiper-item v-for="slide in slides" :key="slide.id">
      <text>{{ slide.title }}</text>
    </swiper-item>
  </swiper>
</fui-swiper-dot>

请在页面定义 slides、current 和 handleSwiperChange;后者可读取 event.detail.current 更新索引。

属性 ​

属性类型说明官网默认值
itemsArray轮播数据[]
typeNumber / String1 圆点、2 数字、3 标题、4 右侧数字索引1
currentNumber / String当前项索引,从 0 开始0
stylesObject指示器样式配置{}
fieldStringtype 为 3 时读取标题的字段名-

styles 可配置 left、right、bottom、width、activeWidth、height、radius、background、activeBackground、color、activeColor、size、margin 和 padding。本地默认尺寸与间距使用 rpx;设置标题模式时,请确保当前 items[current] 存在并包含 field 对应的字段。

事件 ​

事件说明回调参数
click点击指示器{ index }

插槽 ​

插槽说明
default放置轮播容器