From 3b08eee8c73f994c4164ba9ad7cdcea01765c0b8 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 6 Sep 2021 22:47:56 +0800 Subject: [PATCH] fix: ts error --- components/button/buttonTypes.ts | 2 +- components/vc-overflow/Item.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/button/buttonTypes.ts b/components/button/buttonTypes.ts index 87b1f498d..3ed0857f9 100644 --- a/components/button/buttonTypes.ts +++ b/components/button/buttonTypes.ts @@ -29,7 +29,7 @@ const buttonProps = () => ({ type: String as PropType, }, loading: { - type: [Boolean, Object], + type: [Boolean, Object] as PropType, default: (): boolean | { delay?: number } => false, }, disabled: PropTypes.looseBool, diff --git a/components/vc-overflow/Item.tsx b/components/vc-overflow/Item.tsx index 246bf4d33..b374a9c8e 100644 --- a/components/vc-overflow/Item.tsx +++ b/components/vc-overflow/Item.tsx @@ -14,7 +14,7 @@ export default defineComponent({ item: PropTypes.any, renderItem: Function as PropType<(item: any) => VueNode>, responsive: Boolean, - itemKey: [String, Number], + itemKey: { type: [String, Number] as PropType }, registerSize: Function as PropType<(key: Key, width: number | null) => void>, display: Boolean, order: Number, @@ -29,7 +29,7 @@ export default defineComponent({ // ================================ Effect ================================ function internalRegisterSize(width: number | null) { - props.registerSize(props.itemKey!, width); + props.registerSize(props.itemKey, width); } onUnmounted(() => {