vuetify-draggable-treeview icon indicating copy to clipboard operation
vuetify-draggable-treeview copied to clipboard

Insert, children = null or empty

Open domschmidt opened this issue 5 years ago • 5 comments

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? =)

domschmidt avatar Dec 16 '19 14:12 domschmidt

@domschmidt I don't have any idea now, because it did not need for my project. But I'll try to fix it so that we can insert node into empty or null children without such workaround.

suusan2go avatar Dec 19 '19 05:12 suusan2go

that would be great =)

Thank you for sharing your idea!

domschmidt avatar Jan 07 '20 22:01 domschmidt

Hello! @suusan2go

I'm currently working on a vue project who need a vuetify draggable treeview, with the feature described there. If you need some help to add this feature, it will be a pleasure to submit a PR. Without response, I'm gonna start a lib based on your work and add the feature described there + some others

Kawacrepe avatar Mar 02 '20 10:03 Kawacrepe

@Kawacrepe I'm sorry for the late reply. I don't have enough time to implement this feature now, so pull requests are welcome!

suusan2go avatar Mar 11 '20 13:03 suusan2go

Did anyone managed to add this feature?

bajki avatar Nov 18 '21 08:11 bajki