diff --git a/.changeset/many-flies-greet.md b/.changeset/many-flies-greet.md new file mode 100644 index 000000000..4e8419c41 --- /dev/null +++ b/.changeset/many-flies-greet.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/tree-select": minor +--- + +feat: 新增支持前置后置内容 diff --git a/.changeset/plenty-monkeys-end.md b/.changeset/plenty-monkeys-end.md new file mode 100644 index 000000000..d0c3ef253 --- /dev/null +++ b/.changeset/plenty-monkeys-end.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +feat(tree-select): 新增支持前置后置内容 diff --git a/packages/ui/tree-select/src/TreeSelect.tsx b/packages/ui/tree-select/src/TreeSelect.tsx index 8532fd785..a88459838 100644 --- a/packages/ui/tree-select/src/TreeSelect.tsx +++ b/packages/ui/tree-select/src/TreeSelect.tsx @@ -75,6 +75,8 @@ export const TreeSelect = forwardRef( itemHeight, height, size = 'md', + prefix, + suffix, ...rest }, ref @@ -250,7 +252,8 @@ export const TreeSelect = forwardRef( clearable={clearable} placeholder={placeholder} displayRender={displayRenderProp} - suffix={menuVisible ? : } + prefix={prefix} + suffix={[menuVisible ? : , suffix]} focused={menuVisible} value={value} onChange={tryChangeValue} @@ -400,6 +403,14 @@ export interface TreeSelectProps * 设置尺寸 */ size?: HiBaseSizeEnum + /** + * 选择框前置内容 + */ + prefix?: React.ReactNode + /** + * 选择框后置内容 + */ + suffix?: React.ReactNode } if (__DEV__) {