From badfd65f2aa200451229d74e689e5c24234d4b07 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 11 Aug 2022 22:44:16 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5615 --- app/src/layout/util.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 7882ffb55..dfcee8901 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -414,9 +414,12 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => { if (layout.model) { json.children = {}; layoutToJSON(layout.model, json.children); - } else { + } else if (layout.headElement) { // 当前页签没有激活时编辑器没有初始化 - json.children = JSON.parse(layout.headElement.getAttribute("data-initdata")||"{}"); + json.children = JSON.parse(layout.headElement.getAttribute("data-initdata") || "{}"); + } else { + // 关闭所有页签 + json.children = {}; } } };