mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 03:18:16 +08:00
修复 someTree 逻辑问题
This commit is contained in:
parent
39bc57068a
commit
f70c2bb155
@ -929,7 +929,17 @@ export function someTree<T extends TreeItem>(
|
||||
tree: Array<T>,
|
||||
iterator: (item: T, key: number, level: number, paths: Array<T>) => boolean
|
||||
): boolean {
|
||||
return !everyTree(tree, iterator);
|
||||
let result = false;
|
||||
|
||||
everyTree(tree, (item: T, key: number, level: number, paths: Array<T>) => {
|
||||
if (iterator(item, key, level, paths)) {
|
||||
result = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user