How to have a root single node
kowiste opened this issue · 1 comments
kowiste commented
Hi,
I'm trying to have a tree in which all the nodes have to be hanging from a single root node.
You can see the data below, in the id 1 I set draggable to false, so can't be modify, but I still can drop a node in the same level that this node, there is any way to disable this?
{ treeData: [ { id: 1, text: "root", isRoot: true, $draggable: false, children: [ { id: 2, text: "node 2", isRoot: false, $draggable: true, $droppable: true, }, { id: 3, text: "node 2-1", isRoot: false, $draggable: true, $droppable: true, }, { id: 4, text: "node 2-2", isRoot: false, $draggable: true, $droppable: true, }, ], }, ], };
phphe commented
There is a prop rootNode, https://he-tree-vue.phphe.com/api.html#rootnode
You may need:
<Tree :rootNode="{$droppable: false}">