mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-05 19:41:40 +08:00
fix(editor): 更新组件配置后,如果当前没有任何依赖,不会触发收集,导致画布不更新
This commit is contained in:
parent
6521fdc988
commit
d33ddcfa65
@ -79,7 +79,9 @@ class Dep extends BaseService {
|
||||
}
|
||||
|
||||
public collectIdle(nodes: MNode[], depExtendedData: DepExtendedData = {}, deep = false, type?: DepTargetType) {
|
||||
let startTask = false;
|
||||
this.watcher.collectByCallback(nodes, type, ({ node, target }) => {
|
||||
startTask = true;
|
||||
idleTask.enqueueTask(
|
||||
({ node, deep, target }) => {
|
||||
this.collectNode(node, target, depExtendedData, deep);
|
||||
@ -93,6 +95,11 @@ class Dep extends BaseService {
|
||||
});
|
||||
|
||||
return new Promise<void>((resolve) => {
|
||||
if (!startTask) {
|
||||
this.emit('collected', nodes, deep);
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
idleTask.once('finish', () => {
|
||||
this.emit('collected', nodes, deep);
|
||||
resolve();
|
||||
|
Loading…
x
Reference in New Issue
Block a user