Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(comp: select): Add number to the type of label #901

Merged
merged 1 commit into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/components/select/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export interface SelectOptionProps {

disabled?: boolean
key?: VKey
label?: string
label?: string | number

customLabel?: string | ((data: SelectOptionProps) => VNodeChild)

Expand All @@ -157,7 +157,7 @@ export interface SelectOptionGroupProps {

children?: SelectOptionProps[]
key?: VKey
label?: string
label?: string | number

customLabel?: string | ((data: SelectOptionGroupProps) => VNodeChild)

Expand All @@ -182,14 +182,14 @@ export type SelectorProps = ExtractInnerPropTypes<typeof optionProps>
export const optionProps = {
disabled: Boolean,
index: { type: Number, required: true },
label: String,
label: { type: [String, Number], required: true },
rawData: { type: Object as PropType<SelectOptionProps>, required: true },
parentKey: { type: [String, Number, Symbol] as PropType<VKey>, default: undefined },
} as const
export type OptionProps = ExtractInnerPropTypes<typeof optionProps>

export const optionGroupProps = {
label: String,
label: { type: [String, Number], required: true },
index: { type: Number, required: true },
rawData: { type: Object as PropType<SelectOptionGroupProps>, required: true },
} as const
Expand Down
2 changes: 1 addition & 1 deletion packages/pro/tree/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const proTreeProps = {
empty: { type: [String, Object] as PropType<string | EmptyProps>, default: undefined },
expandIcon: {
type: [String, Array] as PropType<string | [string, string]>,
default: ['minus-square', 'plus-square'],
default: () => ['minus-square', 'plus-square'],
},
getKey: { type: [String, Function] as PropType<string | ((data: TreeNode) => VKey)>, default: undefined },
header: { type: [String, Object] as PropType<string | HeaderProps>, default: undefined },
Expand Down