EasyUI Forum

General Category => EasyUI for Vue => Topic started by: bbones on January 31, 2020, 05:20:54 AM



Title: expandAll and collapseAll in Vue EasyUI
Post by: bbones on January 31, 2020, 05:20:54 AM
Hi!

Is it possible to make expandAll and collapseAll in EasyUI for Vue tree component?

Or more general question how to call components methods that vue component wrapper doesn't have?

BR
Billy


Title: Re: expandAll and collapseAll in Vue EasyUI
Post by: jarry on February 02, 2020, 09:27:32 PM
Change the state of a node to 'open' to expand and 'closed' to collapse it.
Code:
expand() {
this.data[0].children.forEach(node=>{
this.$set(node,'state','open');
})
},
collapse(){
this.data[0].children.forEach(node=>{
this.$set(node,'state','closed');
})
},


Title: Re: expandAll and collapseAll in Vue EasyUI
Post by: bbones on February 03, 2020, 04:49:26 AM
Thank you, Jarry!

In my case
Code:
this.data.forEach(...

BR