diff --git a/components/empty/index.tsx b/components/empty/index.tsx index afdd6ce35..e1f4f56de 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -5,6 +5,7 @@ import LocaleReceiver from '../locale-provider/LocaleReceiver'; import DefaultEmptyImg from './empty'; import SimpleEmptyImg from './simple'; import { filterEmpty } from '../_util/props-util'; +import PropTypes from '../_util/vue-types'; const defaultEmptyImg = ; const simpleEmptyImg = ; @@ -15,8 +16,6 @@ export interface TransferLocale { export interface EmptyProps { prefixCls?: string; - class?: string; - style?: CSSProperties; imageStyle?: CSSProperties; image?: VNodeTypes | null; description?: VNodeTypes; @@ -29,17 +28,17 @@ interface EmptyType extends FunctionalComponent { install: (app: App) => void; } -const Empty: EmptyType = (props: EmptyProps, { slots }: SetupContext) => { +const Empty: EmptyType = (props: EmptyProps, { slots = {}, attrs }: SetupContext) => { const configProvider = inject('configProvider', defaultConfigProvider); const { getPrefixCls, direction } = configProvider; const { prefixCls: customizePrefixCls, image = defaultEmptyImg, - description, + description = (slots.description && slots.description()) || undefined, imageStyle, - class: className, + class: className = '', ...restProps - } = props; + } = { ...props, ...attrs }; return ( { return (