mirror of https://github.com/ElemeFE/element
Tree: fix type definition (#12941)
parent
74827513d0
commit
7e29e1c66d
|
@ -4,10 +4,18 @@ import { ElementUIComponent } from './component';
|
|||
export interface TreeData {
|
||||
id?: any;
|
||||
label?: string;
|
||||
disabled?: boolean;
|
||||
isLeaf?: boolean;
|
||||
children?: TreeData[];
|
||||
}
|
||||
|
||||
export interface TreeProps {
|
||||
label: string;
|
||||
disabled: string;
|
||||
isLeaf: string;
|
||||
children: string;
|
||||
}
|
||||
|
||||
export interface TreeNode<K, D> {
|
||||
checked: boolean;
|
||||
childNodes: TreeNode<K, D>[];
|
||||
|
@ -25,6 +33,7 @@ export interface TreeNode<K, D> {
|
|||
disabled: boolean;
|
||||
icon: string;
|
||||
key: K;
|
||||
label: string;
|
||||
nextSibling: TreeNode<K, D> | null;
|
||||
previousSibling: TreeNode<K, D> | null;
|
||||
}
|
||||
|
@ -49,7 +58,7 @@ export declare class ElTree<K = any, D = TreeData> extends ElementUIComponent {
|
|||
nodeKey: string;
|
||||
|
||||
/** Configuration options, see the following table */
|
||||
props: object;
|
||||
props: TreeProps;
|
||||
|
||||
/** Method for loading subtree data */
|
||||
load: (data: D, resolve: Function) => void;
|
||||
|
@ -216,7 +225,7 @@ export declare class ElTree<K = any, D = TreeData> extends ElementUIComponent {
|
|||
*
|
||||
* @param by node key or node data
|
||||
*/
|
||||
getNode(by: D | K): D;
|
||||
getNode(by: D | K): TreeNode<K, D>;
|
||||
|
||||
/**
|
||||
* Remove node by key or node data or node instance
|
||||
|
|
Loading…
Reference in New Issue