From bf2bd552ff6bf6208be9a125e40de850e5e34546 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 11 Aug 2022 10:40:20 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=BD=93=E5=89=8D=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=BF=80=E6=B4=BB=E6=97=B6=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E6=B2=A1=E6=9C=89=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/layout/util.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index a90ea5b7d..7882ffb55 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -411,8 +411,13 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => { }); } } else if (layout instanceof Tab) { - json.children = {}; - layoutToJSON(layout.model, json.children); + if (layout.model) { + json.children = {}; + layoutToJSON(layout.model, json.children); + } else { + // 当前页签没有激活时编辑器没有初始化 + json.children = JSON.parse(layout.headElement.getAttribute("data-initdata")||"{}"); + } } };