Skip to content

Commit

Permalink
feat(tree-select): 支持前缀后缀内容 (XiaoMi#2823)
Browse files Browse the repository at this point in the history
* feat(tree-select): 支持前置后置内容(XiaoMi#2822)

* chore(tree-select): 删除测试代码

* chore(tree-select): 生成变更记录文件

---------

Co-authored-by: xiamiao <[email protected]>
  • Loading branch information
2 people authored and yangxuexue committed Jun 28, 2024
1 parent ad7cffa commit 6e140e8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/many-flies-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/tree-select": minor
---

feat: 新增支持前置后置内容
5 changes: 5 additions & 0 deletions .changeset/plenty-monkeys-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

feat(tree-select): 新增支持前置后置内容
13 changes: 12 additions & 1 deletion packages/ui/tree-select/src/TreeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export const TreeSelect = forwardRef<HTMLDivElement | null, TreeSelectProps>(
itemHeight,
height,
size = 'md',
prefix,
suffix,
...rest
},
ref
Expand Down Expand Up @@ -250,7 +252,8 @@ export const TreeSelect = forwardRef<HTMLDivElement | null, TreeSelectProps>(
clearable={clearable}
placeholder={placeholder}
displayRender={displayRenderProp}
suffix={menuVisible ? <UpOutlined /> : <DownOutlined />}
prefix={prefix}
suffix={[menuVisible ? <UpOutlined /> : <DownOutlined />, suffix]}
focused={menuVisible}
value={value}
onChange={tryChangeValue}
Expand Down Expand Up @@ -400,6 +403,14 @@ export interface TreeSelectProps
* 设置尺寸
*/
size?: HiBaseSizeEnum
/**
* 选择框前置内容
*/
prefix?: React.ReactNode
/**
* 选择框后置内容
*/
suffix?: React.ReactNode
}

if (__DEV__) {
Expand Down

0 comments on commit 6e140e8

Please sign in to comment.