el-table

 

  toggleRowExpansionAll (data, isExpansion) {
      data.forEach((item) => {
        this.$refs.tableCheck.toggleRowExpansion(item, isExpansion);
        if (item.children !== undefined && item.children !== null) {
          this.toggleRowExpansionAll(item.children, isExpansion);
        }
      });
    },
<span
                  class="curPointer"
                  @click="toggleRowExpansionAll(treeData, true)"
                  >全部展开
                </span>
                |
                <span
                  class="curPointer"
                  @click="toggleRowExpansionAll(treeData, false)"
                  >全部收起</span
                >

 

posted @ 2024-05-22 17:22  ThisCall  阅读(14)  评论(0编辑  收藏  举报