Browse Source

feature: vertical支持horizontalAlign设置

es6
guy 2 years ago
parent
commit
d9749ad7a7
  1. 19
      src/core/platform/web/config.js

19
src/core/platform/web/config.js

@ -45,6 +45,25 @@ BI.prepares.push(function () {
scrollx: true scrollx: true
}, ob, {type: "bi.inline"}); }, 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) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize = false; var hasAutoAndFillColumnSize = false;

Loading…
Cancel
Save