-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(Loading): update api docs (#370)
* docs(Loading): update api docs * docs(Loading): update api for miniprogram
- Loading branch information
Showing
10 changed files
with
203 additions
and
69 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/products/tdesign-mobile-react/src/loading/defaultProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdLoadingProps } from './type'; | ||
|
||
export const loadingDefaultProps: TdLoadingProps = { | ||
attach: '', | ||
delay: 0, | ||
duration: 800, | ||
fullscreen: false, | ||
indicator: true, | ||
inheritColor: false, | ||
layout: 'horizontal', | ||
loading: true, | ||
pause: false, | ||
preventScrollThrough: true, | ||
size: '20px', | ||
theme: 'circular', | ||
}; |
34 changes: 34 additions & 0 deletions
34
packages/products/tdesign-mobile-react/src/loading/loading.en-US.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Loading Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
attach | String / Function | '' | Typescript:`AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
content | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
delay | Number | 0 | \- | N | ||
duration | Number | 800 | \- | N | ||
fullscreen | Boolean | false | \- | N | ||
indicator | TNode | true | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
inheritColor | Boolean | false | \- | N | ||
layout | String | horizontal | options: horizontal/vertical | N | ||
loading | Boolean | true | \- | N | ||
pause | Boolean | false | \- | N | ||
preventScrollThrough | Boolean | true | \- | N | ||
reverse | Boolean | - | \- | N | ||
size | String | '20px' | \- | N | ||
text | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
theme | String | circular | options: circular/spinner/dots | N | ||
|
||
### loading 或 LoadingPlugin | ||
|
||
name | params | default | description | ||
-- | -- | -- | -- | ||
options | Function | - | required。Typescript:`boolean \| TdLoadingProps` | ||
|
||
插件返回值:`LoadingInstance【interface LoadingInstance { hide: () => void }】` |
34 changes: 34 additions & 0 deletions
34
packages/products/tdesign-mobile-react/src/loading/loading.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Loading Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N | ||
attach | String / Function | '' | 挂载元素,默认挂载到组件本身所在的位置。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
children | TNode | - | 子元素,同 content。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
content | TNode | - | 子元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
delay | Number | 0 | 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 | N | ||
duration | Number | 800 | 加载动画执行完成一次的时间,单位:毫秒 | N | ||
fullscreen | Boolean | false | 是否显示为全屏加载 | N | ||
indicator | TNode | true | 加载指示符,值为 true 显示默认指示符,值为 false 则不显示,也可以自定义指示符。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
inheritColor | Boolean | false | 是否继承父元素颜色 | N | ||
layout | String | horizontal | 对齐方式。可选项:horizontal/vertical | N | ||
loading | Boolean | true | 是否处于加载状态 | N | ||
pause | Boolean | false | 是否暂停动画 | N | ||
preventScrollThrough | Boolean | true | 防止滚动穿透,全屏加载模式有效 | N | ||
reverse | Boolean | - | 加载动画是否反向 | N | ||
size | String | '20px' | 尺寸,示例:20px | N | ||
text | TNode | - | 加载提示文案。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
theme | String | circular | 加载组件类型。可选项:circular/spinner/dots | N | ||
|
||
### loading 或 LoadingPlugin | ||
|
||
参数名称 | 参数类型 | 参数默认值 | 参数描述 | ||
-- | -- | -- | -- | ||
options | Function | - | 必需。TS 类型:`boolean \| TdLoadingProps` | ||
|
||
插件返回值:`LoadingInstance【interface LoadingInstance { hide: () => void }】` |
92 changes: 92 additions & 0 deletions
92
packages/products/tdesign-mobile-react/src/loading/type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TNode, AttachNode } from '../common'; | ||
|
||
export interface TdLoadingProps { | ||
/** | ||
* 挂载元素,默认挂载到组件本身所在的位置。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body | ||
* @default '' | ||
*/ | ||
attach?: AttachNode; | ||
/** | ||
* 子元素,同 content | ||
*/ | ||
children?: TNode; | ||
/** | ||
* 子元素 | ||
*/ | ||
content?: TNode; | ||
/** | ||
* 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 | ||
* @default 0 | ||
*/ | ||
delay?: number; | ||
/** | ||
* 加载动画执行完成一次的时间,单位:毫秒 | ||
* @default 800 | ||
*/ | ||
duration?: number; | ||
/** | ||
* 是否显示为全屏加载 | ||
* @default false | ||
*/ | ||
fullscreen?: boolean; | ||
/** | ||
* 加载指示符,值为 true 显示默认指示符,值为 false 则不显示,也可以自定义指示符 | ||
* @default true | ||
*/ | ||
indicator?: TNode; | ||
/** | ||
* 是否继承父元素颜色 | ||
* @default false | ||
*/ | ||
inheritColor?: boolean; | ||
/** | ||
* 对齐方式 | ||
* @default horizontal | ||
*/ | ||
layout?: 'horizontal' | 'vertical'; | ||
/** | ||
* 是否处于加载状态 | ||
* @default true | ||
*/ | ||
loading?: boolean; | ||
/** | ||
* 是否暂停动画 | ||
* @default false | ||
*/ | ||
pause?: boolean; | ||
/** | ||
* 防止滚动穿透,全屏加载模式有效 | ||
* @default true | ||
*/ | ||
preventScrollThrough?: boolean; | ||
/** | ||
* 加载动画是否反向 | ||
*/ | ||
reverse?: boolean; | ||
/** | ||
* 尺寸,示例:20px | ||
* @default '20px' | ||
*/ | ||
size?: string; | ||
/** | ||
* 加载提示文案 | ||
*/ | ||
text?: TNode; | ||
/** | ||
* 加载组件类型 | ||
* @default circular | ||
*/ | ||
theme?: 'circular' | 'spinner' | 'dots'; | ||
} | ||
|
||
export interface LoadingInstance { | ||
hide: () => void; | ||
} | ||
|
||
export type LoadingMethod = (options: boolean | TdLoadingProps) => LoadingInstance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters