From ce55d0e9cc6253cf9ab2cfe2f7daf0370c03ceb9 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 27 Mar 2021 15:35:06 +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 | 70 +++++++++++----------- src/less/core/wrapper/flex.horizontal.less | 47 +++++++++------ src/less/core/wrapper/flex.vertical.less | 49 +++++++++------ 3 files changed, 94 insertions(+), 72 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 78cf5bffa..02764ae06 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -107,41 +107,41 @@ BI.prepares.push(function () { return ob; }); - 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.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_center_adapt", 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"}); - } - }); + // 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.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_center_adapt", 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"}); + // } + // }); BI.Plugin.configWidget("bi.radio", function (ob) { if (BI.isIE() && BI.getIEVersion() <= 9) { diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index c20a7c55a..452aeca4c 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -63,15 +63,19 @@ flex-wrap: nowrap; &.v-middle { - /* 09版 */ - -webkit-box-align: center; - /* 12版 */ - -webkit-align-items: center; - -moz-align-items: center; - -ms-align-items: center; - -ms-flex-align: center; - -o-align-items: center; - align-items: center; + ///* 09版 */ + //-webkit-box-align: center; + ///* 12版 */ + //-webkit-align-items: center; + //-moz-align-items: center; + //-ms-align-items: center; + //-ms-flex-align: center; + //-o-align-items: center; + //align-items: center; + > * { + margin-top: auto !important; + margin-bottom: auto !important; + } } &.v-bottom { @@ -99,15 +103,22 @@ } &.h-center { - /* 09版 */ - -webkit-box-pack: center; - /* 12版 */ - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -ms-flex-pack: center; - -o-justify-content: center; - justify-content: center; + ///* 09版 */ + //-webkit-box-pack: center; + ///* 12版 */ + //-webkit-justify-content: center; + //-moz-justify-content: center; + //-ms-justify-content: center; + //-ms-flex-pack: center; + //-o-justify-content: center; + //justify-content: center; + > *:first-child { + margin-left: auto !important; + } + + > *:last-child { + margin-right: auto !important; + } } &.h-right { diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index eb22290b5..7b123be52 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -28,7 +28,7 @@ flex-direction: row; } -.bi-f-v, .bi-flex-vertical-layout{ +.bi-f-v, .bi-flex-vertical-layout { .flex(); .vertical(); @@ -62,15 +62,19 @@ flex-wrap: nowrap; &.h-center { - /* 09版 */ - -webkit-box-align: center; - /* 12版 */ - -webkit-align-items: center; - -moz-align-items: center; - -ms-align-items: center; - -ms-flex-align: center; - -o-align-items: center; - align-items: center; + ///* 09版 */ + //-webkit-box-align: center; + ///* 12版 */ + //-webkit-align-items: center; + //-moz-align-items: center; + //-ms-align-items: center; + //-ms-flex-align: center; + //-o-align-items: center; + //align-items: center; + > * { + margin-left: auto !important; + margin-right: auto !important; + } } &.h-right { @@ -98,15 +102,22 @@ } &.v-middle { - /* 09版 */ - -webkit-box-pack: center; - /* 12版 */ - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -ms-flex-pack: center; - -o-justify-content: center; - justify-content: center; + ///* 09版 */ + //-webkit-box-pack: center; + ///* 12版 */ + //-webkit-justify-content: center; + //-moz-justify-content: center; + //-ms-justify-content: center; + //-ms-flex-pack: center; + //-o-justify-content: center; + //justify-content: center; + > *:first-child { + margin-left: auto !important; + } + + > *:last-child { + margin-right: auto !important; + } } &.v-bottom {