From 44fa5651dfb2e32c4ece43f5fb3f5dd2908ce0de Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 6 Apr 2021 23:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 44 ++++++++++++--------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index ea1c29cf6c..c515a983e6 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -74,39 +74,27 @@ BI.prepares.push(function () { return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); }); - BI.Plugin.configWidget("bi.flex_horizontal", function (ob) { - if (ob.scrollable === true || ob.scrolly === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"}); - } - }); - BI.Plugin.configWidget("bi.flex_vertical", function (ob) { - if (ob.scrollable === true || ob.scrollx === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"}); - } - }); - BI.Plugin.configWidget("bi.flex_horizontal_adapt", function (ob) { - if (ob.scrollable === true || ob.scrollx === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"}); + BI.Plugin.configWidget("bi.left_right_vertical_adapt", function (ob) { + if (isSupportFlex()) { + // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 + // if (!BI.isIE() || (ob.scrollable !== true && ob.scrolly !== true)) { + return BI.extend({}, ob, {type: "bi.flex_left_right_vertical_adapt"}); + // } } + return ob; }); - BI.Plugin.configWidget("bi.flex_vertical_adapt", function (ob) { - if (ob.scrollable === true || ob.scrolly === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"}); + BI.Plugin.configWidget("bi.flex_horizontal", function (ob) { + if (ob.scrollable === true || ob.scrollx !== false) { + if (ob.hgap > 0 || ob.rgap > 0) {// flex中最后一个margin-right不生效 + return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"}); + } } }); - BI.Plugin.configWidget("bi.flex_horizontal_center_adapt", function (ob) { + BI.Plugin.configWidget("bi.flex_vertical", function (ob) { if (ob.scrollable === true || ob.scrollx === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"}); - } - }); - BI.Plugin.configWidget("bi.flex_vertical_center_adapt", function (ob) { - if (ob.scrollable === true || ob.scrolly === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"}); - } - }); - BI.Plugin.configWidget("bi.flex_center_adapt", function (ob) { - if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) { - return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"}); + if (ob.hgap > 0 || ob.rgap > 0) {// flex中最后一个margin-right不生效 + return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"}); + } } });