提交 a775b792 编写于 作者: Y yaoyuchi

add swiper animation curve attribute

Signed-off-by: Nyaoyuchi <yaoyuchi@huawei.com>
上级 4a77f414
...@@ -39,8 +39,9 @@ Swiper(value:{controller?: SwiperController}) ...@@ -39,8 +39,9 @@ Swiper(value:{controller?: SwiperController})
| duration | number | 400 | 子组件切换的动画时长,单位为毫秒。 | | duration | number | 400 | 子组件切换的动画时长,单位为毫秒。 |
| vertical | boolean | false | 是否为纵向滑动。 | | vertical | boolean | false | 是否为纵向滑动。 |
| itemSpace | Length | 0 | 设置子组件与子组件之间间隙。 | | itemSpace | Length | 0 | 设置子组件与子组件之间间隙。 |
| $cachedCount^{8+}$ | number | 1 | 设置预加载子组件个数。 | | cachedCount<sup>8+</sup> | number | 1 | 设置预加载子组件个数。 |
| $disableSwipe^{8+}$ | boolean | false | 禁用组件滑动切换功能。 | | disableSwipe<sup>8+</sup> | boolean | false | 禁用组件滑动切换功能。 |
| curve<sup>8+</sup> | [Curve](ts-animatorproperty.md#Curve枚举说明) \| Curves | Curve.Ease | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-animatorproperty.md#Curve枚举说明),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。 |
### SwiperController ### SwiperController
...@@ -49,8 +50,8 @@ Swiper容器组件的控制器,可以将此对象绑定至Swiper组件,然 ...@@ -49,8 +50,8 @@ Swiper容器组件的控制器,可以将此对象绑定至Swiper组件,然
| 接口名称 | 功能描述 | | 接口名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| showNext():void; | 翻至下一页。 | | showNext():void | 翻至下一页。 |
| showPrevious():void; | 翻至上一页。 | | showPrevious():void | 翻至上一页。 |
## 事件 ## 事件
...@@ -117,6 +118,7 @@ struct SwiperExample { ...@@ -117,6 +118,7 @@ struct SwiperExample {
.duration(1000) .duration(1000)
.vertical(false) // 默认横向切换 .vertical(false) // 默认横向切换
.itemSpace(0) .itemSpace(0)
.curve(Curve.Linear) // 动画曲线
.onChange((index: number) => { .onChange((index: number) => {
console.info(index.toString()) console.info(index.toString())
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册