Open rzorzorzo opened 4 years ago
I've created a PR that attaches a toggle()
method to the node passed to the click
event handler: https://github.com/ParadeTo/vue-tree-list/pull/93
Also (if it helps) I was able to expand/collapse the entire tree using:
toggleFileTree (expand = true) {
// Only need to toggle top level nodes
this
.$refs[ 'treeView' ] // Needed to get access to Vue component
.$children
.forEach ( comp => {
if ( expand === comp.expanded ) {
comp.toggle ();
}
} )
;
}
toggleFileTree (true); // Expand all
toggleFileTree (false); // Collapse all
currently one can only set expanded only for the complete tree and not for single nodes. it would be able to programmatically expand specific nodes.