@perfma/heaven
Version:
An UI Framework base [Ant Design V4](https://ant.design/components/overview-cn/) for React.
54 lines (53 loc) • 1.37 kB
TypeScript
import React from 'react';
import './letter-index-list.less';
declare type LetterGroupItem = {
id: string | number;
name: string;
isLetter?: boolean;
};
declare type LetterGroup = {
letter: string;
children: LetterGroupItem[];
};
export interface LetterIndexListProps {
/**
* @description 源数组,[数据格式](#lettergroup)
* @default 无
*/
dataSource?: LetterGroup[];
/**
* @description 元素是否可选择
* @default true
*/
selectable?: boolean;
/**
* @description 选择模式下,初始选项
* @default 无
*/
initialValue?: any;
/**
* @description 容器高度
* @default 400
*/
height?: number | string;
/**
* @description 容器宽度
* @default 194
*/
width?: number | string;
/**
* @description 元素点击事件
* @default 无
*/
onChange?: ({ selected, item, }: {
selected: any;
item: LetterGroupItem;
}) => void;
/**
* @description 元素自定义渲染函数
* @default 无
*/
itemRender?: (item: LetterGroupItem) => React.ReactElement;
}
declare const LetterIndexList: React.FC<LetterIndexListProps>;
export default LetterIndexList;