phphe / he-tree-vue

A draggable sortable vue tree component, with dragging placeholder, types definition.

Home Page:https://hetree.phphe.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get Parent Node Of the dropped Node

medicareamaze opened this issue · comments

I am trying to identify the Parent Node of the dropped node.

<Tree ref="tree" @drop="ondrop">
</Tree>

ondrop(store) {
      var parent = this.tree.getNodeParentByPath(store.targetPath)
      console.log(parent)
}

It looks like store.targetPath is still referencing the original node. I tried your example from another issue posted in [https://github.com//issues/65]

let t = store.targetPath.slice(0) t[t.length - 1]++ console.log(store.targetTree.getNodeByPath(t));

It still does not work. I just need to get the Parent ID of the node and my project will be complete. This is now becoming a show stopper. Any help is really appreciated

The issue has been fixed since he-tree-vue@3.1.0. Check #20

This example is deprecated. #65

Thanks! It works!