Skip to content

Commit

Permalink
fix(select): fix warning when type of option value is boolean (#4932)
Browse files Browse the repository at this point in the history
* fix(select): 修复 option value 为 boolean 时控制台类型错误警告(#4922)

* fix(select): 修改 onCreate 类型错误
  • Loading branch information
SaberA1ter authored Jan 19, 2025
1 parent 54afff8 commit d5a048a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/select/option-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ export default {
},
/** 选项值 */
value: {
type: [String, Number] as PropType<TdOptionProps['value']>,
type: [String, Number, Boolean] as PropType<TdOptionProps['value']>,
},
};
4 changes: 2 additions & 2 deletions src/select/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export interface TdSelectProps<T extends SelectOption = SelectOption> {
/**
* 当选择新创建的条目时触发
*/
onCreate?: (value: string | number) => void;
onCreate?: (value: string | number | boolean) => void;
/**
* 回车键按下时触发。`inputValue` 表示输入框的值,`value` 表示选中值
*/
Expand Down Expand Up @@ -292,7 +292,7 @@ export interface TdOptionProps {
/**
* 选项值
*/
value?: string | number;
value?: string | number | boolean;
}

export interface TdOptionGroupProps {
Expand Down

0 comments on commit d5a048a

Please sign in to comment.