mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 新增测试树表
This commit is contained in:
@ -57,7 +57,9 @@ export function useTreeTable<A extends NaiveUI.TreeTableApiFn>(
|
||||
});
|
||||
|
||||
// if defaultExpandAll is true, expand all nodes
|
||||
expandedRowKeys.value = defaultExpandAll ? records.map(item => item[idField]) : [records[0][idField]];
|
||||
expandedRowKeys.value = defaultExpandAll
|
||||
? records.map(item => item[idField])
|
||||
: records.filter(item => item[parentIdField] === 0).map(item => item[idField]) || [];
|
||||
|
||||
return { data: treeData };
|
||||
},
|
||||
@ -138,7 +140,7 @@ export function useTreeTable<A extends NaiveUI.TreeTableApiFn>(
|
||||
/** collapse all nodes */
|
||||
function collapseAll() {
|
||||
toggleCollapse();
|
||||
expandedRowKeys.value = data.value.length ? [data.value[0][idField]] : [];
|
||||
expandedRowKeys.value = [];
|
||||
}
|
||||
|
||||
scope.run(() => {
|
||||
|
Reference in New Issue
Block a user