From 3fe96172df733f02edc4b4c74a30b7d7d3ffe0e5 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 18 Jul 2022 18:47:27 +0800 Subject: [PATCH] =?UTF-8?q?BI-109153=20feat:=20tootip=E5=81=9A=E4=B8=80?= =?UTF-8?q?=E4=B8=8B=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容使用比较多的disabled:true + warningTitle场景 --- src/base/single/0.single.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index a5c9f3168..087e0e943 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -34,7 +34,12 @@ BI.Single = BI.inherit(BI.Widget, { tooltipOpt = title; } else { tooltipOpt.level = this.getTipType() || "success"; - tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); + // 由于以前的用法,存在大量disabled:true搭配warningTitle的情况,所以这里做一个兼容,disabled:true的情况下,依然优先显示warningTitle,避免只设置了warningTitle而没有设置title的情况 + if (BI.isNull(o.tipType && !this.isEnabled())) { + tooltipOpt.text = (this.getWarningTitle() || title); + } else { + tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); + } } if (BI.isKey(tooltipOpt.text)) { BI.Tooltips.show(e, this.getName(), tooltipOpt, this, opt);