vue-draggable-nested-tree icon indicating copy to clipboard operation
vue-draggable-nested-tree copied to clipboard

Make only parent undraggable

Open wdamaral opened this issue 5 years ago • 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)

wdamaral avatar Sep 22 '19 19:09 wdamaral

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)) }); } } }

steeldimon avatar Sep 24 '19 12:09 steeldimon