mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
cc223a102c
* feat: start the implementation of the fullscreen prop in Spin * docs: change main spin demo * docs: enhance demo * test: update snapshot * fix: address pr comments * fix: use logical property on fullscreen class * fix: address pr review * feat: Added background color token * fix: remove onClick and change demo * feat: change spin to white when fullcreen also use the bgmask as background, removing the bgColor token * fix: unused import * test: update snapshot * Update components/spin/style/index.tsx Signed-off-by: lijianan <574980606@qq.com> * fix: use white color from token * fix: not needed interpolation and version * fix: address pr review * fix: tip prop was not working * test: cover tip & fullscreen case * fix: addrress pr coments --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: lijianan <574980606@qq.com> Co-authored-by: MadCcc <1075746765@qq.com>
1.8 KiB
1.8 KiB
category | group | title | subtitle | cover | coverDark | demo | ||
---|---|---|---|---|---|---|---|---|
Components | 反馈 | Spin | 加载中 | https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*5mC5TomY4B0AAAAAAAAAAAAADrJ8AQ/original | https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*i43_ToFrL8YAAAAAAAAAAAAADrJ8AQ/original |
|
用于页面和区块的加载中状态。
何时使用
页面局部处于等待异步数据或正在渲染过程时,合适的加载动效会有效缓解用户的焦虑。
代码演示
基本用法
各种大小
容器
卡片加载中
自定义描述文案
延迟
自定义指示符
全屏
API
通用属性参考:通用属性
参数 | 说明 | 类型 | 默认值 | 版本 |
---|---|---|---|---|
delay | 延迟显示加载效果的时间(防止闪烁) | number (毫秒) | - | |
indicator | 加载指示符 | ReactNode | - | |
size | 组件大小,可选值为 small default large |
string | default |
|
spinning | 是否为加载中状态 | boolean | true | |
tip | 当作为包裹元素时,可以自定义描述文案 | ReactNode | - | |
wrapperClassName | 包装器的类属性 | string | - | |
fullscreen | 显示带有 Spin 组件的背景 |
boolean | false | 5.11.0 |
静态方法
-
Spin.setDefaultIndicator(indicator: ReactNode)
你可以自定义全局默认 Spin 的元素。