mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
combo 减少没必要的更新
This commit is contained in:
parent
bb2bff5670
commit
78247ad8a7
@ -367,12 +367,14 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
}
|
||||
|
||||
let value = this.getValueAsArray();
|
||||
let isModified = false;
|
||||
this.subFormDefaultValues = this.subFormDefaultValues.map(
|
||||
({index, values, setted}) => {
|
||||
const newValue = flat ? values.flat : {...values};
|
||||
|
||||
if (!setted && isObjectShallowModified(value[index], newValue)) {
|
||||
value[index] = flat ? values.flat : {...values};
|
||||
isModified = true;
|
||||
}
|
||||
|
||||
return {
|
||||
@ -383,6 +385,10 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
}
|
||||
);
|
||||
|
||||
if (!isModified) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (flat && joinValues) {
|
||||
value = value.join(delimiter || ',');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user