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) {