diff --git a/api-generator/components/tree.js b/api-generator/components/tree.js index 0f0e2b1a9..433d4f39b 100644 --- a/api-generator/components/tree.js +++ b/api-generator/components/tree.js @@ -127,11 +127,31 @@ const TreeEvents = [ } ]; +const TreeSlots = [ + { + name: 'loadingicon', + description: 'Custom loading icon template.' + }, + { + name: 'searchicon', + description: 'Custom search icon template.' + }, + { + name: 'togglericon', + description: 'Custom toggler icon template.' + }, + { + name: 'checkboxicon', + description: 'Custom checkbox icon template.' + } +]; + module.exports = { tree: { name: 'Tree', description: 'Tree is used to display hierarchical data.', props: TreeProps, - events: TreeEvents + events: TreeEvents, + slots: TreeSlots } }; diff --git a/components/lib/tree/Tree.d.ts b/components/lib/tree/Tree.d.ts index ecbaefff8..5c0ae0f6b 100755 --- a/components/lib/tree/Tree.d.ts +++ b/components/lib/tree/Tree.d.ts @@ -168,15 +168,45 @@ export interface TreeProps { */ export interface TreeSlots { /** - * Optional slots. - * @todo + * Custom loading icon template. */ - [key: string]: (scope: { + loadingicon(): VNode[]; + /** + * Custom search icon template. + */ + searchicon(): VNode[]; + /** + * Custom toggler icon template. + */ + togglericon(scope: { /** * Tree node instance */ node: TreeNode; - }) => VNode[]; + /** + * Expanded state of the node + */ + expanded: boolean; + }): VNode[]; + /** + * Custom checkbox icon + */ + checkboxicon(scope: { + /** + * Check state of the node + */ + checked: boolean; + /** + * Partial check state of the node + */ + partialChecked: boolean; + }): VNode[]; + /** + * Optional slots. + * @todo + */ + + [key: string]: (node: any) => VNode[]; } /** diff --git a/components/lib/tree/Tree.vue b/components/lib/tree/Tree.vue index a8d12d6c2..74b74823a 100755 --- a/components/lib/tree/Tree.vue +++ b/components/lib/tree/Tree.vue @@ -2,12 +2,16 @@
- + + +