mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
fix(hooks): 修复树表全部展开问题(临时)
This commit is contained in:
@ -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;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user