daweilv / treejs

A lightweight tree widget, compatible with VanillaJS / React / Vue. Tiny size after gzip. Zero dependence.
MIT License
142 stars 49 forks source link

myTree.collapseAll is not a function #26

Open DarthSonic opened 1 year ago

DarthSonic commented 1 year ago

myTree.collapseAll is not a function

const myTree = new Tree(...);

myTree has no definition for collapseAll

ch3sn3k commented 1 year ago

It seems that this functionality was removed in version 1.8.3. This version is available through npm but not uploaded here on Github. @daweilv Can you please update the repo to the latest version 1.8.3?

So far you can use

const treeGui = new Tree('#container', {
    data: treData,
    // only expand level 1 node
    closeDepth: 1,
});

as a replacement. See the sourcecode in npm package.