This commit is contained in:
ljx
2025-08-29 14:58:31 +08:00
parent 6eed9d9244
commit 7c2e4d7e14
5 changed files with 18 additions and 23 deletions

View File

@ -17,10 +17,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="toggleExpandAll(true)">一键展开</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="toggleExpandAll(false)">一键收起</el-button>
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
</el-form-item>
<el-form-item>
@ -163,11 +160,12 @@ const changeSheet = (val: any) => {
getTableData();
};
//展开树
const toggleExpandAll = (isExpand: boolean) => {
const toggleExpandAll = () => {
isExpandAll.value = !isExpandAll.value;
console.log(isExpandAll.value);
tableData.value.forEach((row) => {
tableRef.value.toggleRowExpansion(row, isExpand);
tableRef.value.toggleRowExpansion(row, isExpandAll.value);
});
isExpandAll.value = isExpand;
};
//获取版本号