fix: 优化获取 simulator 的逻辑, 解决偶现 style 没被注入的问题

This commit is contained in:
力皓 2021-04-23 14:47:51 +08:00
parent 27451bfe91
commit f84ec7e72e

View File

@ -1,4 +1,4 @@
import { editor, designer } from '@ali/lowcode-engine'; import { project } from '@ali/lowcode-engine';
import { toCss } from '@ali/vu-css-style'; import { toCss } from '@ali/vu-css-style';
export function stylePropsReducer(props: any, node: any) { 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) { function appendStyleNode(props: any, styleProp: any, cssClass: string, cssId: string) {
const doc = designer.currentDocument?.simulator?.contentDocument; const doc = project.simulator?.contentDocument;
if (!doc) { if (!doc) {
return; return;
} }