# swiper

滑块视图容器,支持子组件

# 属性

支持通用属性

名称 类型 默认值 必填 描述
index <number> 0 当前显示的子组件索引
indicator <boolean> true 是否启用 indicator,默认 true
vertical <boolean> false 滑动方向是否为纵向,纵向时 indicator 也为纵向
previousmargin <string> 0px 前边距,可用于露出前一项的一小部分,支持单位:px 和%
nextmargin <string> 0px 后边距,可用于露出后一项的一小部分,支持单位:px 和%

备注previousmarginnextmargin的总和不应该超过整个 swiper 大小的 1/2,超过部分将会被截取。

# 样式

支持通用样式

名称 类型 默认值 必填 描述
indicator-color <color> #7f000000 indicator 填充颜色
indicator-selected-color <color> #33b4ff indicator 选中时的颜色
indicator-size <length> 20px indicator 组件的直径大小
indicator-[top|left|right|bottom] <length> | <percentage> - indicator 相对于 swiper 的位置

# 事件

支持通用事件

名称 参数 描述
change {index:currentIndex} 当前显示的组件索引变化时触发
swipestart 2+ {index:number} swiper子组件切换动画开始时触发(如果是手指拖动导致的切换,指的是手指按压开始拖动的时间点),参数index为事件触发时swiper组件当前显示的子组件的索引值。
swipeend 2+ {index:number} swiper组件的子组件切换动画结束时触发,参数index为事件触发时swiper组件当前显示的子组件的索引值。

# 方法

名称 参数 描述
swipeTo {index: number(指定位置)} swiper 滚动到 index 位置
swiper组件的基本用法
滑块视图容器
基本用法
```html ```
复制代码
图标 图标
图标 图标
图标
设计尺寸:750X750
纵向视图
```html ```
复制代码
图标 图标
图标 图标
图标
设计尺寸:750X750