Skip to content

Commit f5cf7e0

Browse files
committed
fix: functional compoent support vue3.0.3
1 parent fa320e6 commit f5cf7e0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

components/empty/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties, VNodeTypes, inject, SetupContext, FunctionalComponent } from 'vue';
1+
import { CSSProperties, VNodeTypes, inject, FunctionalComponent } from 'vue';
22
import classNames from '../_util/classNames';
33
import { defaultConfigProvider } from '../config-provider';
44
import LocaleReceiver from '../locale-provider/LocaleReceiver';
@@ -30,7 +30,7 @@ interface EmptyType extends FunctionalComponent<EmptyProps> {
3030
PRESENTED_IMAGE_SIMPLE: VNodeTypes;
3131
}
3232

33-
const Empty: EmptyType = (props: EmptyProps, { slots = {}, attrs }: SetupContext) => {
33+
const Empty: EmptyType = (props, { slots = {}, attrs }) => {
3434
const configProvider = inject('configProvider', defaultConfigProvider);
3535
const { getPrefixCls, direction } = configProvider;
3636
const {

components/vc-select/TransBtn.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SetupContext, VNodeChild } from 'vue';
1+
import { FunctionalComponent, VNodeChild } from 'vue';
22
import PropTypes from '../_util/vue-types';
33

44
export interface TransBtnProps {
@@ -9,7 +9,11 @@ export interface TransBtnProps {
99
onClick?: (payload: MouseEvent) => void;
1010
}
1111

12-
const TransBtn = (props: TransBtnProps, { slots }: SetupContext) => {
12+
export interface TransBtnType extends FunctionalComponent<TransBtnProps> {
13+
displayName: string;
14+
}
15+
16+
const TransBtn: TransBtnType = (props, { slots }) => {
1317
const { class: className, customizeIcon, customizeIconProps, onMousedown, onClick } = props;
1418
let icon: VNodeChild;
1519

@@ -48,6 +52,7 @@ const TransBtn = (props: TransBtnProps, { slots }: SetupContext) => {
4852
};
4953

5054
TransBtn.inheritAttrs = false;
55+
TransBtn.displayName = 'TransBtn';
5156
TransBtn.props = {
5257
class: PropTypes.string,
5358
customizeIcon: PropTypes.any,

0 commit comments

Comments
 (0)