David-Desmaisons / Vue.D3.tree

Vue component to display tree based on D3.js layout.
https://david-desmaisons.github.io/Vue.D3.tree/tree
MIT License
874 stars 136 forks source link

How to use the "identifier" props? #62

Closed yasmineTYM closed 4 years ago

yasmineTYM commented 4 years ago

Hi David, I need to update the tree dynamically and required to use the "identifier" according to the documentation, could you please give me more explanation about it? Thanks a lot !!!

David-Desmaisons commented 4 years ago

I depends do you need to refresh the reload the tree at some point? If so, you should worry about it and return a unique identifier of the node. Something like:

 function getId (node) {
    return node.id;
 }