From d9749ad7a798c175f56e1c3e80ffe996cc97b847 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 13 Jun 2022 13:25:14 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20vertical=E6=94=AF=E6=8C=81horizontal?= =?UTF-8?q?Align=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 3bd279aab..bcbf6caa4 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -45,6 +45,25 @@ BI.prepares.push(function () { scrollx: true }, ob, {type: "bi.inline"}); }); + BI.Plugin.configWidget("bi.vertical", function (ob) { + if (ob.horizontalAlign === BI.HorizontalAlign.Left || ob.horizontalAlign === BI.HorizontalAlign.Right) { + if (isSupportFlex()) { + return BI.extend({}, ob, {type: "bi.flex_vertical"}); + } + return BI.extend({}, ob, { + horizontalAlign: BI.HorizontalAlign.Stretch, + type: "bi.vertical", + items: BI.map(ob.items, function (item) { + return { + type: "bi.inline", + horizontalAlign: ob.horizontalAlign, + items: [item] + }; + }) + }); + } + return ob; + }); BI.Plugin.configWidget("bi.inline", function (ob) { // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 var hasAutoAndFillColumnSize = false;