From 8eceda54c5732063737e48141300b2ed2f24f687 Mon Sep 17 00:00:00 2001 From: Geoffrey Deldique Date: Thu, 21 Jul 2022 17:14:40 +0200 Subject: [PATCH 1/3] Set attribute "data-node-id" on each node --- src/components/TreeNode.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/TreeNode.vue b/src/components/TreeNode.vue index 45766a4..682114e 100644 --- a/src/components/TreeNode.vue +++ b/src/components/TreeNode.vue @@ -12,13 +12,14 @@ @keydown.up.stop="up" @keydown.down.stop="down" > -
Date: Sat, 23 Jul 2022 13:10:48 +0200 Subject: [PATCH 2/3] use "id" instead of "data-node-id" --- src/components/TreeNode.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TreeNode.vue b/src/components/TreeNode.vue index 682114e..45c9013 100644 --- a/src/components/TreeNode.vue +++ b/src/components/TreeNode.vue @@ -19,7 +19,7 @@ :ref="setWrapperRef" :draggable="draggable" :tabindex="tabIndex" - :data-node-id="node.id" + :id="node.id" @blur="blur" @click.stop="focus" @dragstart.stop="dragstart" From a4a04136b1cdabb963624fd02b47f4f358f48eb7 Mon Sep 17 00:00:00 2001 From: Geoffrey Deldique Date: Sat, 23 Jul 2022 13:13:19 +0200 Subject: [PATCH 3/3] create API methods "open" and "focus" to enable node interactions --- src/dev.vue | 567 ++++++++++++++++++++++--------------------- src/setup/useTree.ts | 34 ++- 2 files changed, 327 insertions(+), 274 deletions(-) diff --git a/src/dev.vue b/src/dev.vue index e568c54..b714004 100644 --- a/src/dev.vue +++ b/src/dev.vue @@ -1,130 +1,144 @@