🐛 当前页签没有激活时编辑器没有初始化

This commit is contained in:
Vanessa 2022-08-11 10:40:20 +08:00
parent dc14da855a
commit bf2bd552ff

View file

@ -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")||"{}");
}
}
};