N00ts / vue3-treeview

a simple treeview in vue js 3
MIT License
71 stars 61 forks source link

Load nodes data from server #52

Closed felahdab closed 2 months ago

felahdab commented 2 months ago

Hi.

Thank you very much for this component which seems to fit a great number of use cases.

I can't find the proper way to load the data from the server.

I initialize the Tree from some static data. Then I trigger a call to the server which sends me back the new nodes and the new roots in a json object.

Then I try to update the nodes and root properties.

Unfortunately, the Tree disappears and there is an error in the console.

Can you provide an example of how to load the data from the server and refresh the Tree ?

This would probably be a nice addition to the documentation.

Regards. Florian.

felahdab commented 2 months ago

Finally found a way.

I had to specify the state of the nodes (as []) to avoid raising an exception when replacing the content of nodes by the data sent from the server.

Apart from that, everything works as expected.

Regards.