import React from 'react'; import './style/index.less'; export interface EmptyProps extends React.HTMLAttributes { prefixCls?: string; icon?: React.ReactNode; size?: number | string; iconProps?: React.SVGProps; /** 自定义描述内容 */ description?: React.ReactNode; } const Empty = (props: EmptyProps) => { const { prefixCls = 'w-empty', className, icon, iconProps, size = 64, description = '暂无数据', children, ...other } = props; const cls = [prefixCls, className].filter(Boolean).join(' ').trim(); return (
{icon ? ( icon ) : ( )}
{description &&
{description}
} {children &&
{children}
}
); }; export default Empty;