diff --git a/types/tree.d.ts b/types/tree.d.ts index 71075d027..cc06003ad 100644 --- a/types/tree.d.ts +++ b/types/tree.d.ts @@ -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 { checked: boolean; childNodes: TreeNode[]; @@ -25,6 +33,7 @@ export interface TreeNode { disabled: boolean; icon: string; key: K; + label: string; nextSibling: TreeNode | null; previousSibling: TreeNode | null; } @@ -49,7 +58,7 @@ export declare class ElTree 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 extends ElementUIComponent { * * @param by node key or node data */ - getNode(by: D | K): D; + getNode(by: D | K): TreeNode; /** * Remove node by key or node data or node instance