diff --git a/changelog.md b/changelog.md index c60ea6a88..5857959e2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-05) +- 修复bi.button设置宽度并配置iconCls后,文本很长的情况下显示截断的问题 - 填加bi-user-select-enable和bi-user-select-disable通用类名 - 修复树系列多层半选状态下,勾选祖先节点,后代节点不受影响的问题 - 修复上传控件多个title问题 diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 85ab78d06..52461bdfd 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -9,6 +9,10 @@ */ BI.Button = BI.inherit(BI.BasicButton, { + _const: { + iconWidth: 18 + }, + _defaultConfig: function (props) { var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { @@ -50,7 +54,7 @@ BI.Button = BI.inherit(BI.BasicButton, { this.icon = BI.createWidget({ type: "bi.icon_label", cls: o.iconCls, - width: 18, + width: this._const.iconWidth, height: o.height - 2, iconWidth: o.iconWidth, iconHeight: o.iconHeight @@ -58,6 +62,8 @@ BI.Button = BI.inherit(BI.BasicButton, { this.text = BI.createWidget({ type: "bi.label", text: o.text, + textWidth: BI.isNotNull(o.textWidth) ? o.textWidth - this._const.iconWidth : null, + textHeight: o.textHeight, value: o.value, height: o.height - 2 });