From f84ec7e72ef6a0fc2f9a62faf0067e49948d9786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=9B=E7=9A=93?= Date: Fri, 23 Apr 2021 14:47:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=20s?= =?UTF-8?q?imulator=20=E7=9A=84=E9=80=BB=E8=BE=91,=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=81=B6=E7=8E=B0=20style=20=E6=B2=A1=E8=A2=AB=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vision-polyfill/src/props-reducers/style-reducer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/vision-polyfill/src/props-reducers/style-reducer.ts b/packages/vision-polyfill/src/props-reducers/style-reducer.ts index 5830e71cd..e9b05d708 100644 --- a/packages/vision-polyfill/src/props-reducers/style-reducer.ts +++ b/packages/vision-polyfill/src/props-reducers/style-reducer.ts @@ -1,4 +1,4 @@ -import { editor, designer } from '@ali/lowcode-engine'; +import { project } from '@ali/lowcode-engine'; import { toCss } from '@ali/vu-css-style'; export function stylePropsReducer(props: any, node: any) { @@ -28,7 +28,8 @@ export function stylePropsReducer(props: any, node: any) { } function appendStyleNode(props: any, styleProp: any, cssClass: string, cssId: string) { - const doc = designer.currentDocument?.simulator?.contentDocument; + const doc = project.simulator?.contentDocument; + if (!doc) { return; }