Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to have a root single node #45

Open
Kowiste opened this issue Feb 24, 2021 · 1 comment
Open

How to have a root single node #45

Kowiste opened this issue Feb 24, 2021 · 1 comment

Comments

@Kowiste
Copy link

Kowiste commented Feb 24, 2021

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
Copy link
Owner

phphe commented Feb 24, 2021

There is a prop rootNode, https://he-tree-vue.phphe.com/api.html#rootnode
You may need:

<Tree :rootNode="{$droppable: false}">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants