mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 04:18:29 +08:00
fix: isNaN 会导致 store 不停更新 (#2222)
This commit is contained in:
parent
a46b37588d
commit
d484bd16ba
@ -1,5 +1,6 @@
|
||||
import isPlainObject from 'lodash/isPlainObject';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNaN from 'lodash/isNaN';
|
||||
import uniq from 'lodash/uniq';
|
||||
import {Schema, PlainObject, FunctionPropertyNames} from '../types';
|
||||
import {evalExpression} from './tpl';
|
||||
@ -313,6 +314,8 @@ export function isObjectShallowModified(
|
||||
ignoreUndefined
|
||||
)
|
||||
);
|
||||
} else if (isNaN(prev) && isNaN(next)) {
|
||||
return false;
|
||||
} else if (
|
||||
null == prev ||
|
||||
null == next ||
|
||||
@ -338,9 +341,7 @@ export function isObjectShallowModified(
|
||||
for (let i: number = keys.length - 1; i >= 0; i--) {
|
||||
let key = keys[i];
|
||||
if (
|
||||
strictMode
|
||||
? next[key] !== prev[key]
|
||||
: isObjectShallowModified(next[key], prev[key], false, ignoreUndefined)
|
||||
isObjectShallowModified(next[key], prev[key], strictMode, ignoreUndefined)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user