From 4889554cfd5c41c01032712a47a18fc3b61bb2f9 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 1 Nov 2022 17:07:12 +0800 Subject: [PATCH] =?UTF-8?q?DESIGN-4355=20feat:=20tooltip=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 0d42ec143..c13e02e81 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -33,8 +33,10 @@ BI.Single = BI.inherit(BI.Widget, { var title = this.getTitle(); if (title instanceof Promise) { + this.requestingTitle = title; title.then(resolvedTitle => { - this.mouseOver && showToolTip(this._getTooltipOptions(resolvedTitle)); + // 由于是异步的,所以无法避免Promise resolve时机问题,所以设计为:鼠标移出了则不显示,并且只显示最后一次发起的查询结果 + this.mouseOver && this.requestingTitle === title && showToolTip(this._getTooltipOptions(resolvedTitle)); }); } else { showToolTip(this._getTooltipOptions(title));