From 719928a02c8d4fb295a5412a94447c59e52b7b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=9B=E7=9A=93?= Date: Wed, 2 Jun 2021 11:13:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20disableAutoRender?= =?UTF-8?q?=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/designer/src/builtin-simulator/host.ts | 8 +++++++- packages/engine/src/engine-core.ts | 4 ++++ packages/react-simulator-renderer/src/renderer-view.tsx | 1 + packages/react-simulator-renderer/src/renderer.ts | 8 ++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/designer/src/builtin-simulator/host.ts b/packages/designer/src/builtin-simulator/host.ts index 989c0f663..fb0048e78 100644 --- a/packages/designer/src/builtin-simulator/host.ts +++ b/packages/designer/src/builtin-simulator/host.ts @@ -1,4 +1,4 @@ -import { obx, autorun, computed, getPublicPath, hotkey, focusTracker } from '@ali/lowcode-editor-core'; +import { obx, autorun, computed, getPublicPath, hotkey, focusTracker, engineConfig } from '@ali/lowcode-editor-core'; import { EventEmitter } from 'events'; import { ISimulatorHost, Component, NodeInstance, ComponentInstance, DropContainer } from '../simulator'; import Viewport from './viewport'; @@ -138,10 +138,16 @@ export class BuiltinSimulatorHost implements ISimulatorHost { // sync layout config this._layout = host.project.get('config').layout; @@ -386,6 +388,11 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer { @computed get componentsMap(): any { return this._componentsMap; } + + /** + * 是否为画布自动渲染 + */ + autoRender = true; /** * 加载资源 */ @@ -523,6 +530,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer { * 刷新渲染器 */ rerender() { + this.autoRender = true; // TODO: 不太优雅 this._appContext = { ...this._appContext }; }