From 4532253422211f1aa156b9cd15a9e053df3d929b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 19 Jul 2023 15:57:15 +0300 Subject: [PATCH] Refactor #4149 - For Tree --- components/lib/tree/Tree.d.ts | 9 +++++++++ components/lib/tree/TreeNode.vue | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/components/lib/tree/Tree.d.ts b/components/lib/tree/Tree.d.ts index 8859926e5..e95518650 100755 --- a/components/lib/tree/Tree.d.ts +++ b/components/lib/tree/Tree.d.ts @@ -212,6 +212,10 @@ export interface TreeState { * Defines current options in Tree component. */ export interface TreeContext { + /** + * Index of the node. + */ + index: number; /** * Current expanded state of the node as a boolean. * @defaultValue false @@ -227,6 +231,11 @@ export interface TreeContext { * @defaultValue false */ checked: boolean; + /** + * Current leaf state of the node as a boolean. + * @defaultValue false + */ + leaf: boolean; } /** diff --git a/components/lib/tree/TreeNode.vue b/components/lib/tree/TreeNode.vue index 4eac6d06a..a76f4d918 100755 --- a/components/lib/tree/TreeNode.vue +++ b/components/lib/tree/TreeNode.vue @@ -114,9 +114,11 @@ export default { getPTOptions(key) { return this.ptm(key, { context: { + index: this.index, expanded: this.expanded, selected: this.selected, - checked: this.checked + checked: this.checked, + leaf: this.leaf } }); },