From 9403c0d6cbb9d85cc015e02afa6fe6a8d975aa5d Mon Sep 17 00:00:00 2001 From: liuzaijiang <530604689@qq.com> Date: Wed, 11 May 2022 18:12:33 +0800 Subject: [PATCH] fix(comp: select): Add number to the type of label --- packages/components/select/src/types.ts | 8 ++++---- packages/pro/tree/src/types.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/select/src/types.ts b/packages/components/select/src/types.ts index 7b76ad36a..548b32bd6 100644 --- a/packages/components/select/src/types.ts +++ b/packages/components/select/src/types.ts @@ -134,7 +134,7 @@ export interface SelectOptionProps { disabled?: boolean key?: VKey - label?: string + label?: string | number customLabel?: string | ((data: SelectOptionProps) => VNodeChild) @@ -157,7 +157,7 @@ export interface SelectOptionGroupProps { children?: SelectOptionProps[] key?: VKey - label?: string + label?: string | number customLabel?: string | ((data: SelectOptionGroupProps) => VNodeChild) @@ -182,14 +182,14 @@ export type SelectorProps = ExtractInnerPropTypes export const optionProps = { disabled: Boolean, index: { type: Number, required: true }, - label: String, + label: { type: [String, Number], required: true }, rawData: { type: Object as PropType, required: true }, parentKey: { type: [String, Number, Symbol] as PropType, default: undefined }, } as const export type OptionProps = ExtractInnerPropTypes export const optionGroupProps = { - label: String, + label: { type: [String, Number], required: true }, index: { type: Number, required: true }, rawData: { type: Object as PropType, required: true }, } as const diff --git a/packages/pro/tree/src/types.ts b/packages/pro/tree/src/types.ts index eaaac1ca3..953b98575 100644 --- a/packages/pro/tree/src/types.ts +++ b/packages/pro/tree/src/types.ts @@ -36,7 +36,7 @@ export const proTreeProps = { empty: { type: [String, Object] as PropType, default: undefined }, expandIcon: { type: [String, Array] as PropType, - default: ['minus-square', 'plus-square'], + default: () => ['minus-square', 'plus-square'], }, getKey: { type: [String, Function] as PropType VKey)>, default: undefined }, header: { type: [String, Object] as PropType, default: undefined },