mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-24 09:02:10 +08:00
fix(core): 异步加载数据源时,数据源事件配置失效
This commit is contained in:
parent
f5cb19dfa4
commit
1031595a97
@ -167,8 +167,13 @@ class App extends EventEmitter {
|
||||
this.setPage(pageId);
|
||||
|
||||
if (this.dataSourceManager) {
|
||||
const dataSourceList = Array.from(this.dataSourceManager.dataSourceMap.values());
|
||||
this.eventHelper?.bindDataSourceEvents(dataSourceList);
|
||||
if (this.dataSourceManager.isAllDataSourceRegistered()) {
|
||||
this.eventHelper?.bindDataSourceEvents();
|
||||
} else {
|
||||
this.dataSourceManager.once('registered-all', () => {
|
||||
this.eventHelper?.bindDataSourceEvents();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,9 @@ export default class EventHelper extends EventEmitter {
|
||||
this.nodeEventList.clear();
|
||||
}
|
||||
|
||||
public bindDataSourceEvents(dataSourceList: DataSource[]) {
|
||||
public bindDataSourceEvents() {
|
||||
const dataSourceList = Array.from(this.app.dataSourceManager?.dataSourceMap.values() || []);
|
||||
|
||||
this.removeDataSourceEvents(dataSourceList);
|
||||
|
||||
dataSourceList.forEach((dataSource) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user