Skip to content

Insert, children = null or empty #19

@domschmidt

Description

@domschmidt

Great work!

What about if there is no children and I want to insert a node to another node, that has no children? currently it does not work at all.

... node.vue:


            <draggable
                    @input="updateValue"
            >


            /**
            * Workaround if there is no child yet
            */
            move(value: any): void {
               const parent = value.relatedContext.component.$parent;
               const isNodeComponent = parent.updateChildValue;
               if (!parent.hasChildren && isNodeComponent ) {
                     const insertedElement: TreeItem = value.draggedContext.element;
                    parent.updateChildValue(insertedElement);
               }
            }

Any better idea? =)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions