28 lines
693 B
TypeScript
28 lines
693 B
TypeScript
import type { SelectProps } from "antd/es/select";
|
|
import type { FC } from "react";
|
|
|
|
/**
|
|
* 组件属性
|
|
*/
|
|
export interface BasicSelectProps extends SelectProps {
|
|
/** 数据源 */
|
|
data: Record<string, any>[];
|
|
/** 数据 label 字段,默认 name */
|
|
nameKey?: string;
|
|
/** 数据 value 字段,默认 id */
|
|
idKey?: string;
|
|
/** 占位符 */
|
|
placeholder?: string;
|
|
/** 获取 label */
|
|
onGetLabel?: (label: string) => void;
|
|
/** 获取数据 */
|
|
onGetData?: (data: Record<string, any>[]) => void;
|
|
}
|
|
|
|
/**
|
|
* 基础下拉组件(不建议直接使用此组件,二次继承使用)
|
|
*/
|
|
declare const BasicSelectTree: FC<BasicSelectProps>;
|
|
|
|
export default BasicSelectTree;
|