Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert, children = null or empty #19

Open
domschmidt opened this issue Dec 16, 2019 · 5 comments
Open

Insert, children = null or empty #19

domschmidt opened this issue Dec 16, 2019 · 5 comments

Comments

@domschmidt
Copy link

domschmidt commented Dec 16, 2019

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

@suusan2go
Copy link
Owner

@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.

@domschmidt
Copy link
Author

that would be great =)

Thank you for sharing your idea!

@Kawacrepe
Copy link

Kawacrepe commented Mar 2, 2020

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

@suusan2go
Copy link
Owner

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

@bajki
Copy link

bajki commented Nov 18, 2021

Did anyone managed to add this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants