Do not overwrite layoutconfig if it already had one

This commit is contained in:
pengfei.zhou
2022-08-04 14:12:59 +08:00
committed by osborn
parent d886458832
commit ea6e079b4f
5 changed files with 9 additions and 5 deletions

View File

@@ -3,12 +3,13 @@ import { layoutConfig } from "./layoutconfig";
export var jsx;
(function (jsx) {
function createElement(constructor, config, ...children) {
var _a;
if (!!constructor.isViewClass) {
const e = new constructor();
if (e instanceof Fragment) {
return children;
}
e.layoutConfig = layoutConfig().fit();
e.layoutConfig = (_a = e.layoutConfig) !== null && _a !== void 0 ? _a : layoutConfig().fit();
if (config) {
e.apply(config);
}