fix(hooks): 修复树表全部展开问题(临时)

This commit is contained in:
xlsea
2025-08-19 11:00:19 +08:00
parent 5581a4a59f
commit 2504498eb5

View File

@ -268,7 +268,19 @@ export function useNaiveTreeTable<ResponseData, ApiData>(options: UseNaiveTreeTa
pagination: false,
getColumnChecks: cols => getColumnChecks(cols, options.getColumnVisible),
getColumns,
onFetched: data => {
onFetched: transformData => {
const data: ApiData[] = [];
const collect = (nodes: any[]) => {
nodes.forEach(node => {
data.push(node);
if (node?.children?.length) {
collect(node.children);
}
});
};
collect(transformData);
rows.value = data;
}
});