还是能缓存
This commit is contained in:
parent
d994507e9f
commit
c7f1837650
|
@ -147,6 +147,7 @@
|
|||
flex-basis: 0;
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.#{$ns}Form-itemColumn--xs,
|
||||
|
|
|
@ -85,9 +85,6 @@ export const FormItemStore = types
|
|||
return self.errorData.map(item => item.msg);
|
||||
}
|
||||
|
||||
let lastQueryValue: any;
|
||||
let lastResult: any = [];
|
||||
|
||||
return {
|
||||
get form(): any {
|
||||
return getForm();
|
||||
|
@ -117,13 +114,8 @@ export const FormItemStore = types
|
|||
},
|
||||
|
||||
getSelectedOptions: (value: any = getValue()) => {
|
||||
if (value === lastQueryValue) {
|
||||
return lastResult;
|
||||
}
|
||||
lastQueryValue = value;
|
||||
|
||||
if (typeof value === 'undefined') {
|
||||
return (lastResult = []);
|
||||
return [];
|
||||
}
|
||||
|
||||
const selected = Array.isArray(value)
|
||||
|
@ -183,7 +175,7 @@ export const FormItemStore = types
|
|||
unMatched && selectedOptions.push(unMatched);
|
||||
});
|
||||
|
||||
return (lastResult = selectedOptions);
|
||||
return selectedOptions;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue