[Solved] [V1] QTree does not expand all by property default-expand-all
-
Dear Quasar team,
I reproduced the issue with below link.
https://codepen.io/Stanley-549393092/pen/RwbrVNr
Normally, when set nodes with fixed value, it will expand all the node because I set the property default-expand-all.
But if the value of nodes is dynamic, it does not work. I also tried using “this.$refs.tree.expandAll()”, it is still not working.
Could you please check it? -
-
@metalsadman Wow, it’s amazing. Thanks!
-
I’m using the same code that uses the expandAll() API to expand all nodes of my q-tree. It works well.
@metalsadman - can you explain why
this.$nextTick(()=>{this.$refs.tree.expandAll()})
is needed in this case?
I first tried, like @Stanley, a simple
$refs.tree.expandAll()
and that does not expand the q-tree.
-
@Mickey58 best explained from vue doc’s api https://vuejs.org/v2/api/#Vue-nextTick.