From 19d40d938bcdd3b428ac9cf9a85bfa0278703768 Mon Sep 17 00:00:00 2001 From: treecat Date: Tue, 21 Jun 2022 16:37:35 +0800 Subject: [PATCH] =?UTF-8?q?DESIGN-4069=20fix:=20button=20=E7=9A=84=20setIc?= =?UTF-8?q?on=20=E4=B8=8D=E4=BD=BF=E7=94=A8=20IconChangeButton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 0ba1468b4..39a116c77 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -77,8 +77,8 @@ } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ - type: "bi.icon_change_button", - iconCls: o.iconCls, + type: "bi.icon_label", + cls: o.iconCls, width: this._const.iconWidth, height: lineHeight, lineHeight: lineHeight @@ -195,10 +195,11 @@ } }, - setIcon: function (iconCls) { - if (this.icon) { - this.options.iconCls = iconCls; - this.icon.setIcon(iconCls); + setIcon: function (cls) { + var o = this.options; + if(this.icon && o.iconCls !== cls) { + this.icon.element.removeClass(o.iconCls).addClass(cls); + o.iconCls = cls; } },