Skip to content

Commit f7ce03c

Browse files
authored
fix(auto-tip): 修复 tooltip 显示的元素,需要消失卸载时, 提示会留在页面的bug (#3574)
1 parent 7f7e780 commit f7ce03c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/vue-directive/src/auto-tip.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ const bind = (el, { value }: { value: BoundingValueType }) => {
111111

112112
const unbind = (el) => {
113113
if (el.boundingValue?.listened) {
114+
const tooltip = globalTooltip.value
115+
if (tooltip && el === tooltip.state.referenceElm && tooltip.state.showPopper) {
116+
tooltip.hide()
117+
}
114118
el.removeEventListener('mouseenter', mouseenterHandler)
115119
el.removeEventListener('mouseleave', mouseleaveHandler)
116120
}

0 commit comments

Comments
 (0)