el-table default-expand-all属性生效但无法动态改变
<el-table
v-if="refreshTable"
:data="xxx"
v-loading="loading"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="id"
>
</el-table>
本来只改变 isExpandAll 的值无法改变展开/折叠状态,后面才知道还要改变一下refreshTable的值,可能是要刷新一下吧
toggleExpandAll(){
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},