From 29244fc8b1985a67ab9452d778d5ee3b3b14f828 Mon Sep 17 00:00:00 2001 From: xiamiao1121 <74885998+xiamiao1121@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:29:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(tree-select):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E5=90=8E=E7=BC=80=E5=86=85=E5=AE=B9=20(#2823?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(tree-select): 支持前置后置内容(#2822) * chore(tree-select): 删除测试代码 * chore(tree-select): 生成变更记录文件 --------- Co-authored-by: xiamiao --- .changeset/many-flies-greet.md | 5 +++++ .changeset/plenty-monkeys-end.md | 5 +++++ packages/ui/tree-select/src/TreeSelect.tsx | 13 ++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .changeset/many-flies-greet.md create mode 100644 .changeset/plenty-monkeys-end.md 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__) {