mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-18 21:38:14 +00:00
refactor: 增加组件后, 重新构造 components, 但不触发重新渲染
This commit is contained in:
parent
70577adc7f
commit
936ad91913
@ -388,7 +388,7 @@ export class Designer {
|
|||||||
this.editor.set('assets', newAssets);
|
this.editor.set('assets', newAssets);
|
||||||
}
|
}
|
||||||
// TODO: 因为涉及修改 prototype.view,之后在 renderer 里修改了 vc 的 view 获取逻辑后,可删除
|
// TODO: 因为涉及修改 prototype.view,之后在 renderer 里修改了 vc 的 view 获取逻辑后,可删除
|
||||||
// this._componentMetasMap = new Map(this._componentMetasMap);
|
this._componentMetasMap = new Map(this._componentMetasMap);
|
||||||
// 完成加载增量资源后发送事件,方便插件监听并处理相关逻辑
|
// 完成加载增量资源后发送事件,方便插件监听并处理相关逻辑
|
||||||
this.editor.emit('designer.incrementalAssetsReady');
|
this.editor.emit('designer.incrementalAssetsReady');
|
||||||
|
|
||||||
|
|||||||
2
packages/designer/tests/fixtures/window.ts
vendored
2
packages/designer/tests/fixtures/window.ts
vendored
@ -18,3 +18,5 @@ Object.defineProperty(window, 'React', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
window.scrollTo = () => {};
|
window.scrollTo = () => {};
|
||||||
|
|
||||||
|
window.console.warn = () => {};
|
||||||
|
|||||||
@ -309,9 +309,9 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
|||||||
...this._components,
|
...this._components,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@obx.ref private _components: any = {};
|
private _components: any = {};
|
||||||
|
|
||||||
@computed get components(): object {
|
get components(): object {
|
||||||
// 根据 device 选择不同组件,进行响应式
|
// 根据 device 选择不同组件,进行响应式
|
||||||
// 更好的做法是,根据 device 选择加载不同的组件资源,甚至是 simulatorUrl
|
// 更好的做法是,根据 device 选择加载不同的组件资源,甚至是 simulatorUrl
|
||||||
return this._components;
|
return this._components;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user