角色
This commit is contained in:
38
src/components/Empty.tsx
Normal file
38
src/components/Empty.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import React from 'react';
|
||||
import { Empty } from 'antd';
|
||||
import { FileTextOutlined } from '@ant-design/icons';
|
||||
|
||||
interface EmptyDataProps {
|
||||
/** 自定义文案 */
|
||||
description?: string;
|
||||
/** 组件高度 */
|
||||
height?: number | string;
|
||||
/** 图标大小 */
|
||||
iconSize?: number;
|
||||
}
|
||||
|
||||
const EmptyData: React.FC<EmptyDataProps> = ({
|
||||
description = '暂无数据',
|
||||
height = 220,
|
||||
iconSize = 56
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
width: '100%',
|
||||
height,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
background: 'transparent'
|
||||
}}
|
||||
>
|
||||
<Empty
|
||||
image={<FileTextOutlined style={{ fontSize: iconSize, color: '#c5c8ce' }} />}
|
||||
description={<span style={{ color: '#999', fontSize: 16 }}>{description}</span>}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default EmptyData;
|
||||
Reference in New Issue
Block a user