Skip to content

how to delete a node using by id (unique) #66

Open
@bci24

Description

@bci24

I am using this in combination with a vue-select - multiple in vue 3.

When I select a user from the list it will push to treeData the object. Ex:

{id:2, text: 'user 2'}

When remove an element from select I can get the object.

The issue that I have is I don't know how to use that function removenodebypath in composition api.

https://he-tree-vue.phphe.com/api.html#removenodebypath

It is possible to remove a node by id (which is unique) - (ex click of a button) and when the node is removed

[{id:1, text: 'user 1'}, {id:2, text: 'user 2'} {id: 3, text: 'user 3', children: [{id: 4, text: 'user 4'}, {id: 5, text: 'user 5'}]}]

(for ex id 3 - according to the treeData from above and it will also remove automatically id 4 and id 5) - and get those id's (all the id's that where removed) ?

Can you show me please how can I use removenodebypath and return the ids from the nodes that where removed ?

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