mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix(helper): 修正everyTree, 增加isObservableArray判断 (#4484)
This commit is contained in:
parent
fee28e2794
commit
52f507a03a
@ -22,7 +22,7 @@ import {
|
||||
resolveVariable,
|
||||
resolveVariableAndFilter
|
||||
} from 'amis-formula';
|
||||
import {isObservable} from 'mobx';
|
||||
import {isObservable, isObservableArray} from 'mobx';
|
||||
|
||||
export {
|
||||
createObject,
|
||||
@ -937,7 +937,7 @@ export function everyTree<T extends TreeItem>(
|
||||
paths: Array<T> = [],
|
||||
indexes: Array<number> = []
|
||||
): boolean {
|
||||
if (!Array.isArray(tree)) {
|
||||
if (!Array.isArray(tree) && !isObservableArray(tree)) {
|
||||
return false;
|
||||
}
|
||||
return tree.every((item, index) => {
|
||||
|
Loading…
Reference in New Issue
Block a user