还是能缓存

This commit is contained in:
liaoxuezhi 2019-11-26 19:04:47 +08:00
parent d994507e9f
commit c7f1837650
2 changed files with 215 additions and 222 deletions

View File

@ -147,6 +147,7 @@
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
width: 0;
}
.#{$ns}Form-itemColumn--xs,

View File

@ -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;
}
};
})