Commit 19831b16 authored by 周宏民's avatar 周宏民

fix: test

parent 3f584f18
Pipeline #53935 failed with stages
in 4 seconds
......@@ -40,11 +40,11 @@
"@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@babel/core": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.17.10",
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@babel/runtime": "^7.17.9",
"@babel/plugin-transform-runtime": "^7.17.10",
"@octokit/core": "^3.2.5",
"@size-limit/preset-big-lib": "^4.5.5",
"@testing-library/react": "^10.0.2",
......@@ -147,6 +147,7 @@
"@wisdom-components/basictable": "^1.5.14",
"@wisdom-components/empty": "^1.3.9",
"@wisdom-components/exportexcel": "^1.1.2",
"@wisdom-components/rich": "file:packages/base-components/rich",
"@wisdom-components/timerangepicker": "^1.3.4",
"@wisdom-utils/utils": "0.0.46",
"classnames": "^2.2.6",
......
# `@wisdom-components/RichText`
# `@wisdom-components/richtext`
> TODO: description
## Usage
```
const RichText = require('@wisdom-components/RichText');
const RichText = require('@wisdom-components/richtext');
// TODO: DEMONSTRATE API
```
/* eslint-disable react-hooks/exhaustive-deps */
import { Spin } from 'antd';
import PropTypes from 'prop-types';
import { useEffect, useState } from 'react';
let timer = null;
const LoadBox = ({
delay,
indicator,
size,
tip,
wrapperClassName,
timeout,
timeoutTip,
spinning,
}) => {
const [loadTip, setloadTip] = useState(tip);
useEffect(() => {
setloadTip(tip);
if (timer) clearTimeout(timer);
if (spinning)
timer = setTimeout(() => {
setloadTip(timeoutTip);
}, timeout);
return () => {
if (timer) clearTimeout(timer);
};
}, [spinning]);
return (
<Spin
delay={delay}
spinning={spinning}
indicator={indicator}
size={size}
tip={loadTip}
wrapperClassName={wrapperClassName}
></Spin>
);
};
LoadBox.defaultProps = {
spinning: true,
delay: 0,
indicator: '',
size: 'default',
tip: '',
wrapperClassName: '',
timeout: 3000,
timeoutTip: '正在加载数据,请耐心等待...',
};
LoadBox.propTypes = {
spinning: PropTypes.bool, // 是否为加载中状态
delay: PropTypes.number, // 延迟显示加载效果的时间(防止闪烁)
indicator: PropTypes.node, // 加载指示符
size: PropTypes.string, // 组件大小,可选值为 small default large
tip: PropTypes.string, // 当作为包裹元素时,可以自定义描述文案
wrapperClassName: PropTypes.string, // 包装器的类属性
timeout: PropTypes.number, // 超时时间
timeoutTip: PropTypes.string, // 超时时间提示
};
export default LoadBox;
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment