mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
Select 去掉 cache 功能,因为 api 本身就具备 cache 功能
This commit is contained in:
parent
992d501954
commit
f8bc3fcfe1
@ -21,9 +21,6 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
||||
};
|
||||
|
||||
input: any;
|
||||
cache: {
|
||||
[propName: string]: any;
|
||||
} = {};
|
||||
unHook: Function;
|
||||
constructor(props: SelectProps) {
|
||||
super(props);
|
||||
@ -133,15 +130,6 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
||||
return (this.unHook = addHook(this.loadRemote.bind(this, input), 'init'));
|
||||
}
|
||||
|
||||
if (this.cache[input]) {
|
||||
let options = this.cache[input] || [];
|
||||
let combinedOptions = this.mergeOptions(options);
|
||||
setOptions(combinedOptions);
|
||||
|
||||
return Promise.resolve({
|
||||
options: combinedOptions
|
||||
});
|
||||
}
|
||||
const ctx = createObject(data, {
|
||||
term: input,
|
||||
value: input
|
||||
@ -158,7 +146,6 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
||||
.fetcher(autoComplete, ctx)
|
||||
.then(ret => {
|
||||
let options = (ret.data && (ret.data as any).options) || ret.data || [];
|
||||
this.cache[input] = options;
|
||||
let combinedOptions = this.mergeOptions(options);
|
||||
setOptions(combinedOptions);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user