From ca4346814e26283c3180fe63f0dcc4a7c7b6ddfc Mon Sep 17 00:00:00 2001 From: treecat Date: Fri, 26 Aug 2022 09:40:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20fix:=E6=8C=89=E9=92=AE=20textAl?= =?UTF-8?q?ign=20=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 5 +++++ src/base/single/button/buttons/button.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 420a47d77..651d98e4a 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -376,6 +376,11 @@ Demo.Button = BI.inherit(BI.Widget, { this.loaded(); }, 5 * 1000); }, + }, { + type: "bi.button", + text: "文字偏左的按钮", + textAlign: "left", + width: 200, }]; return { diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 11762c86d..94b590f84 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -141,6 +141,7 @@ // bi.center_adapt 作用:让 hgap 不影响 iconGap。 BI.createWidget({ type: "bi.center_adapt", + horizontalAlign: o.textAlign, element: this, hgap: o.hgap, vgap: o.vgap, @@ -161,7 +162,7 @@ }); if (o.minWidth > 0) { - this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit}); + this.element.css({ "min-width": o.minWidth / BI.pixRatio + BI.pixUnit }); } },