vuetify-draggable-treeview
vuetify-draggable-treeview copied to clipboard
Insert, children = null or empty
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 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.
that would be great =)
Thank you for sharing your idea!
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 I'm sorry for the late reply. I don't have enough time to implement this feature now, so pull requests are welcome!
Did anyone managed to add this feature?