Expand all ancestors
JohnnyMaynne opened this issue · 5 comments
JohnnyMaynne commented
Hello. Is it possible to expand all ancestors for a particular node. I want to create a list of pages and when visiting subpages expand their ancestors.
phphe commented
here is example. change path to yours.
const path = [5,1,1]
tree.foldAll() // fold all nodes
path.forEach((v, i) => {
tree.unfold(tree.getNodeByPath(path.slice(0, i+1)))
});JohnnyMaynne commented
phphe commented
foldAll should be this.$refs.tree.foldAll(). And try short path first. Make sure the path is right.
JohnnyMaynne commented
JohnnyMaynne commented
Either way, it works. Thanks for the help👍


