From 51e03f3eddcac2b19cd02a60c37909835317d742 Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Fri, 2 Oct 2020 22:20:02 +0800 Subject: [PATCH] chore: empty props add `class` and `style` --- components/empty/index.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 5483d6c87..ba15d507d 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,12 +1,4 @@ -import { - CSSProperties, - VNodeTypes, - inject, - App, - SetupContext, - FunctionalComponent, - HTMLAttributes, -} from 'vue'; +import { CSSProperties, VNodeTypes, inject, App, SetupContext, FunctionalComponent } from 'vue'; import classNames from '../_util/classNames'; import { defaultConfigProvider, ConfigConsumerProps } from '../config-provider'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; @@ -22,8 +14,10 @@ export interface TransferLocale { description: string; } -export interface EmptyProps extends HTMLAttributes { +export interface EmptyProps { prefixCls?: string; + class?: any; + style?: string | CSSProperties; imageStyle?: CSSProperties; image?: VNodeTypes | null; description?: VNodeTypes; @@ -42,7 +36,7 @@ const Empty: EmptyType = (props: EmptyProps, { slots = {}, attrs }: SetupContext const { prefixCls: customizePrefixCls, image = defaultEmptyImg, - description = (slots.description && slots.description()) || undefined, + description = slots.description?.() || undefined, imageStyle, class: className = '', ...restProps