概述
使元素按照既定轨迹晃动
API
props
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| type | 使用默认晃动方式,可选值为 ['h', 'v', 'horizontal', 'vertical'] | String | 'h' |
| amplitude | 晃动幅度,单位为 px | Number | 5 |
| interval | 来回晃动一个周期的时间间隔,单位为 ms | Number | 100 |
| times | 晃动次数 | Number | 3 |
| customConfig | 自定义晃动轨迹 | Array | [] |
slot
| name | 说明 |
|---|---|
| <default> | 默认 |
methods
| 方法 | 说明 | 参数 | 返回值 |
|---|---|---|---|
| shake(config) | 开始晃动 | config: Object => {} 或 null | void(0) |
| stopShake | 停止当前晃动 | null | void(0) |
events
| 事件名 | 说明 | 参数 |
|---|---|---|
| on-done | 晃动结束触发的事件 | null |