From 8e2abb8ba308fc77814c228d2b620234ed002cf5 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Tue, 16 Dec 2025 14:53:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96BasicSelect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Select/Basic/index.d.ts | 8 +++++--- components/Select/Basic/index.js | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/Select/Basic/index.d.ts b/components/Select/Basic/index.d.ts index 0e82c67..5674ebd 100644 --- a/components/Select/Basic/index.d.ts +++ b/components/Select/Basic/index.d.ts @@ -1,5 +1,5 @@ import type { SelectProps } from "antd/es/select"; -import type { FC } from "react"; +import type { FC, ReactNode } from "react"; /** * 组件属性 @@ -19,11 +19,13 @@ export interface BasicSelectProps extends SelectProps { onGetOption?: (option: Record | Record[]) => void; /** 获取数据 */ onGetData?: (data: Record[]) => void; + /** 自定义 label 的渲染函数 */ + labelRender?: (item: Record) => ReactNode; } /** * 基础下拉组件(不建议直接使用此组件,二次继承使用) */ -declare const BasicSelectTree: FC; +declare const BasicSelect: FC; -export default BasicSelectTree; +export default BasicSelect; diff --git a/components/Select/Basic/index.js b/components/Select/Basic/index.js index 44c2d12..f634cfc 100644 --- a/components/Select/Basic/index.js +++ b/components/Select/Basic/index.js @@ -14,6 +14,7 @@ function BasicSelect(props) { data = [], nameKey = "name", idKey = "id", + labelRender, ...restProps } = props; @@ -59,7 +60,7 @@ function BasicSelect(props) {