From a0db5e6c893d0ae3fdf2952eadea8db5dcb24a51 Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Wed, 29 Nov 2023 10:06:05 +0800 Subject: [PATCH] docs(statistic): update (#2623) --- src/statistic/statistic.en-US.md | 9 ++++++++- src/statistic/statistic.md | 9 ++++++++- src/statistic/type.ts | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/statistic/statistic.en-US.md b/src/statistic/statistic.en-US.md index 0d53258f9a..10c618bf66 100644 --- a/src/statistic/statistic.en-US.md +++ b/src/statistic/statistic.en-US.md @@ -1,7 +1,6 @@ :: BASE_DOC :: ## API - ### Statistic Props name | type | default | description | required @@ -23,3 +22,11 @@ trend | String | - | trend。options: increase/decrease | N trendPlacement | String | left | Position of trending placements。options: left/right | N unit | TNode | - | Unit content。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N value | Number | - | The value of Statistic | N + +### StatisticInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,Typescript:`React.CSSProperties` | N +start | `(from: number, to: number)` | \- | required。Digital scrolling change, from one number to another number diff --git a/src/statistic/statistic.md b/src/statistic/statistic.md index 79700d3e5b..133e2d726f 100644 --- a/src/statistic/statistic.md +++ b/src/statistic/statistic.md @@ -1,7 +1,6 @@ :: BASE_DOC :: ## API - ### Statistic Props 名称 | 类型 | 默认值 | 说明 | 必传 @@ -23,3 +22,11 @@ trend | String | - | 趋势。可选项:increase/decrease | N trendPlacement | String | left | 趋势展示位置。可选项:left/right | N unit | TNode | - | 单位内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N value | Number | - | 数值显示的值 | N + +### StatisticInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +start | `(from: number, to: number)` | \- | 必需。设置数字滚动变化效果,从一个数字到另一个数字 diff --git a/src/statistic/type.ts b/src/statistic/type.ts index 64f868a4a7..9d82eda32e 100644 --- a/src/statistic/type.ts +++ b/src/statistic/type.ts @@ -73,6 +73,14 @@ export interface TdStatisticProps { value?: number; } +/** 组件实例方法 */ +export interface StatisticInstanceFunctions { + /** + * 设置数字滚动变化效果,从一个数字到另一个数字 + */ + start: (from: number, to: number) => void; +} + export interface animation { duration: number; valueFrom: number;