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

Rejec drop based on node parent property?

Open caiokawasaki opened this issue 6 years ago • 3 comments

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

caiokawasaki avatar Dec 20 '18 16:12 caiokawasaki

you can use the parent of drag placeholder. code: tree.dplh.parent or: node._vm.store.dplh.parent

phphe avatar Dec 21 '18 03:12 phphe

node._vm.store.dplh.parent worked! But how can I access tree inside my dragEnd() function?

caiokawasaki avatar Dec 22 '18 12:12 caiokawasaki

store is tree. https://github.com/phphe/vue-draggable-nested-tree#node-deep-properties-example

phphe avatar Dec 22 '18 13:12 phphe