From f5cf7e0920a51f0ac024046996c99260aa41becf Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Thu, 26 Nov 2020 13:39:18 +0800 Subject: [PATCH] fix: functional compoent support vue3.0.3 --- components/empty/index.tsx | 4 ++-- components/vc-select/TransBtn.tsx | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 412e8e7029..d6d35fe913 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, VNodeTypes, inject, SetupContext, FunctionalComponent } from 'vue'; +import { CSSProperties, VNodeTypes, inject, FunctionalComponent } from 'vue'; import classNames from '../_util/classNames'; import { defaultConfigProvider } from '../config-provider'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; @@ -30,7 +30,7 @@ interface EmptyType extends FunctionalComponent { PRESENTED_IMAGE_SIMPLE: VNodeTypes; } -const Empty: EmptyType = (props: EmptyProps, { slots = {}, attrs }: SetupContext) => { +const Empty: EmptyType = (props, { slots = {}, attrs }) => { const configProvider = inject('configProvider', defaultConfigProvider); const { getPrefixCls, direction } = configProvider; const { diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index 7ea2acc599..9acbe18e86 100644 --- a/components/vc-select/TransBtn.tsx +++ b/components/vc-select/TransBtn.tsx @@ -1,4 +1,4 @@ -import { SetupContext, VNodeChild } from 'vue'; +import { FunctionalComponent, VNodeChild } from 'vue'; import PropTypes from '../_util/vue-types'; export interface TransBtnProps { @@ -9,7 +9,11 @@ export interface TransBtnProps { onClick?: (payload: MouseEvent) => void; } -const TransBtn = (props: TransBtnProps, { slots }: SetupContext) => { +export interface TransBtnType extends FunctionalComponent { + displayName: string; +} + +const TransBtn: TransBtnType = (props, { slots }) => { const { class: className, customizeIcon, customizeIconProps, onMousedown, onClick } = props; let icon: VNodeChild; @@ -48,6 +52,7 @@ const TransBtn = (props: TransBtnProps, { slots }: SetupContext) => { }; TransBtn.inheritAttrs = false; +TransBtn.displayName = 'TransBtn'; TransBtn.props = { class: PropTypes.string, customizeIcon: PropTypes.any,