phphe/vue-draggable-nested-tree

Make only parent undraggable

wdamaral opened this issue · 1 comments

Is there any way to make only the parent node undraggable?
I noticed that if I put draggable = false on the parent node, all of its children also become undraggable.

-Parent (draggable = false)

  • Child (draggable = true)

i'm release something what you mean, with lazy loading tree
When i'm get root element with children, then set data.draggable = false
After all:
loadChildren(slotProps) { var data = slotProps.data if (!data.children.length) { data.children.forEach(function (child) { axios.get(`http://127.0.0.1:8000/dashboard/object/${child.id}`) .then( function (response) { response.data.open = false // current level = 1 (0) // all child make draggable if (slotProps.vm.level > 0) { response.data.draggable = true } data.children.push(response.data) }) .catch(error => console.log(error)) }); } } }