vue-draggable-nested-tree
vue-draggable-nested-tree copied to clipboard
Rejec drop based on node parent property?
I'm facing a little problem. When I call :ondragend="dragEnd"
.
This is my node structure:
{
description:"Minima nihil quia maiores sunt perferendis dolorem aut.",
id: 2,
identifier: "10000.10000",
open: true,
type: 1,
value: "Repellat ut veniam labore enim quasi ad temporibus."
}
Inside the dragEnd
function when I try to access the parent node it always return the previous parent node. How can I solve this?
dragEnd(node) {
if (node.parent.type != 1) {
return false
}
}
you can use the parent of drag placeholder. code: tree.dplh.parent or: node._vm.store.dplh.parent
node._vm.store.dplh.parent
worked! But how can I access tree
inside my dragEnd()
function?
store is tree. https://github.com/phphe/vue-draggable-nested-tree#node-deep-properties-example