Skip to content

Commit

Permalink
fix: functional compoent support vue3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Nov 26, 2020
1 parent fa320e6 commit f5cf7e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/empty/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -30,7 +30,7 @@ interface EmptyType extends FunctionalComponent<EmptyProps> {
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 {
Expand Down
9 changes: 7 additions & 2 deletions components/vc-select/TransBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SetupContext, VNodeChild } from 'vue';
import { FunctionalComponent, VNodeChild } from 'vue';
import PropTypes from '../_util/vue-types';

export interface TransBtnProps {
Expand All @@ -9,7 +9,11 @@ export interface TransBtnProps {
onClick?: (payload: MouseEvent) => void;
}

const TransBtn = (props: TransBtnProps, { slots }: SetupContext) => {
export interface TransBtnType extends FunctionalComponent<TransBtnProps> {
displayName: string;
}

const TransBtn: TransBtnType = (props, { slots }) => {
const { class: className, customizeIcon, customizeIconProps, onMousedown, onClick } = props;
let icon: VNodeChild;

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

TransBtn.inheritAttrs = false;
TransBtn.displayName = 'TransBtn';
TransBtn.props = {
class: PropTypes.string,
customizeIcon: PropTypes.any,
Expand Down

0 comments on commit f5cf7e0

Please sign in to comment.