小程序开放平台

文档中心
表单组件
基础内容
媒体组件
地图
视图容器
movable-area
movable-view
scroll-view
swiper
swiper-item
view
xhs-touch-interceptor-container-view(小组件滚动优化)
开放能力
画布

swiper

开发
>
组件
>
视图容器
>
swiper
>
更新时间:2025-12-09 15:41:02

swiper

滑块视图容器。其中只可放置swiper-item组件,否则会导致未定义的行为。

属性
类型
默认值
必填
说明
indicator-dotsbooleanfalse是否显示面板指示点
indicator-colorstringrgba(0, 0, 0, .3)指示点颜色
indicator-active-colorstring#000000当前选中的指示点颜色
autoplaybooleanfalse是否自动切换
currentnumber0当前所在滑块的 index
intervalnumber5000自动切换时间间隔
durationnumber500滑动动画时长
circularbooleanfalse是否采用衔接滑动
verticalbooleanfalse滑动方向是否为纵向
previous-marginstring0px前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值
next-marginstring0px后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值
bindchangeeventhandlecurrent 改变时会触发 change 事件,event.detail = {current, source}

扫码预览

组件示例

该文档是否对您有帮助?