mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 11:58:10 +08:00
fix: 修复withRemoteConfig 实现的自动刷新无法关闭问题 (#2448)
This commit is contained in:
parent
29009d7e55
commit
a799703409
@ -220,19 +220,20 @@ export function withRemoteConfig<P = any>(
|
||||
);
|
||||
} else if (env && isEffectiveApi(source, data)) {
|
||||
this.loadConfig();
|
||||
this.toDispose.push(
|
||||
reaction(
|
||||
() => {
|
||||
const api = normalizeApi(source as string);
|
||||
return api.trackExpression
|
||||
? tokenize(api.trackExpression, store.data)
|
||||
: buildApi(api, store.data, {
|
||||
ignoreData: true
|
||||
}).url;
|
||||
},
|
||||
() => this.loadConfig()
|
||||
)
|
||||
);
|
||||
source.autoRefresh !== false &&
|
||||
this.toDispose.push(
|
||||
reaction(
|
||||
() => {
|
||||
const api = normalizeApi(source as string);
|
||||
return api.trackExpression
|
||||
? tokenize(api.trackExpression, store.data)
|
||||
: buildApi(api, store.data, {
|
||||
ignoreData: true
|
||||
}).url;
|
||||
},
|
||||
() => this.loadConfig()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user