vue.jsecmascript-6sortablejsvuedraggable

how to clone an vuedraggable element into its sibling's nested children list?


https://codesandbox.io/s/fervent-oskar-shqtp?file=/src/components/nested-draggable.vue

pull operation is working fine, but when I change the pull prop from 'true' to 'clone', error occurred.

NotFoundError Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.


Solution

  • set another prop 'revertClone' to true inside the group props solved the problem.

    <draggable :group="{ name: 'g1', pull: 'clone', revertClone: true }"></draggable>