From 83aaa703b69ad68de706cb384b07b6975e2b08ea Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 20 Jul 2022 10:42:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20titile=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 2 +- src/base/single/button/buttons/button.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 087e0e943..47dc6718f 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -35,7 +35,7 @@ BI.Single = BI.inherit(BI.Widget, { } else { tooltipOpt.level = this.getTipType() || "success"; // 由于以前的用法,存在大量disabled:true搭配warningTitle的情况,所以这里做一个兼容,disabled:true的情况下,依然优先显示warningTitle,避免只设置了warningTitle而没有设置title的情况 - if (BI.isNull(o.tipType && !this.isEnabled())) { + if (BI.isNull(o.tipType) && !this.isEnabled()) { tooltipOpt.text = (this.getWarningTitle() || title); } else { tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 6cc48ba54..420b5f7aa 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -112,12 +112,12 @@ tgap: o.iconPosition === "top" ? o.iconGap : 0, bgap: o.iconPosition === "bottom" ? o.iconGap : 0 }; - var items = [this.icon, BI.extend({el: this.text}, gapContainer)]; + var items = [this.icon, BI.extend({ el: this.text }, gapContainer)]; if (isVertical(o.iconPosition)) { layoutType = "bi.vertical"; } if (o.iconPosition === "right" || o.iconPosition === "bottom") { - items = [BI.extend({el: this.text}, gapContainer), this.icon]; + items = [BI.extend({ el: this.text }, gapContainer), this.icon]; } BI.createWidget({ type: "bi.center_adapt", @@ -147,7 +147,8 @@ rgap: o.rgap, element: this, text: o.text, - value: o.value + value: o.value, + title: null, }); } var classArr = ["block", "clear", "ghost", "plain", "loading", "light"]; @@ -159,7 +160,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 }); } },