ukelli-ui
Version:
Base on React's UI lib. Make frontend's dev simpler and faster.
48 lines (47 loc) • 1.16 kB
TypeScript
import { Component } from "react";
interface DataItem {
child?: DataItem[];
active?: any;
title: string;
value: any;
id: string;
}
interface TreeListProps {
/** 树结构数据 */
treeData: DataItem[];
onChange: (val: any) => void;
/** 用于匹配对应字段 */
fieldMapper?: {
child: string;
title: string;
active: string;
value: any;
id: string;
};
defaultValue?: {};
}
export default class TreeList extends Component<TreeListProps, {
activeLevel: {};
selectedItems: any;
}> {
static defaultProps: {
fieldMapper: {
child: string;
title: string;
active: string;
value: string;
id: string;
};
defaultValue: {};
};
selectedItems: any;
constructor(props: any);
componentDidMount(): void;
getDefaultActiveItems: () => {};
itemFilter: (item: any) => any;
getChildIDs: (targetNode: any) => {};
onCheck: (targetNode: any, parentNode?: any) => void;
onToggle: (levelId: any, nextActiveState: any) => void;
render(): JSX.Element;
}
export {};