1. Click the button to expand all, and then el-tree will expand all
2. Click the button to collapse all, and then el-tree collapses all
3. Use: default-expand-all= "isExpand", dynamically change the value of isExpand, the value changes, but the tree does not change
4. How do you make it happen?
html Code:
< el-tree
class="filter-tree treeoverflow"
:data="data2"
:props="defaultProps"
highlight-current
:filter-node-method="filterNode"
@node-click="handleNodeClick"
:default-expand-all="isExpand"
ref="tree2">
</el-tree>
js Code:
isExpand(){
console.log("isExpand()");
this.czlx=this.$store.state.ysml.czlx;
if( this.czlx=="111") {
console.log(""+this.czlx);
this.iscolspann=false;
return false;
}else if( this.czlx=="222"){
console.log("");
this.iscolspann=true;
return true;
}else{
return false;
}
},