From 311a26b054234ba1f056bc0e5f8e6d6aed0ca050 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 29 Mar 2021 11:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index de1a203b9..d6cac0123 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -21,18 +21,19 @@ BI.prepares.push(function () { // 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况) // 主要出现在center_adapt或者horizontal_adapt的场景,或者主动设置horizontalAlign的场景 if (ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch) { - var justOneItem = (ob.items && ob.items.length <= 1); - // 在这种情况下,也可以通过flex支持该布局 - if (supportFlex) { - // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 - // if (!isIE || (ob.scrollable !== true && ob.scrolly !== true)) { - return BI.extend({}, ob, { - type: "bi.flex_horizontal", - horizontalAlign: !justOneItem && ob.horizontalAlign === BI.HorizontalAlign.Center - ? BI.HorizontalAlign.Left : ob.horizontalAlign - }); - // } - } + // 虽然有两个元素以上的时候,有场景是控制一个显示一个隐藏的效果,还无法通过flex来实现 + // var justOneItem = (ob.items && ob.items.length <= 1); + // // 在这种情况下,也可以通过flex支持该布局 + // if (supportFlex) { + // // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 + // // if (!isIE || (ob.scrollable !== true && ob.scrolly !== true)) { + // return BI.extend({}, ob, { + // type: "bi.flex_horizontal", + // horizontalAlign: !justOneItem && ob.horizontalAlign === BI.HorizontalAlign.Center + // ? BI.HorizontalAlign.Left : ob.horizontalAlign + // }); + // // } + // } // // IE9以上可以使用calc计算布局 // if (!isIE || BI.getIEVersion() > 8) { // return BI.extend({}, ob, {