Skip to content

Commit

Permalink
Tree: fix type definition (#12941)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZSkycat authored and ziyoung committed Sep 30, 2018
1 parent 7482751 commit 7e29e1c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions types/tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>[];
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7e29e1c

Please sign in to comment.