fix: 点击页面任意位置时关闭Peak Infomation Tooltip

This commit is contained in:
Xu Zhimeng 2023-12-13 14:32:13 +08:00
parent 53f0c25cdd
commit 6a3f99177b

View File

@ -252,6 +252,7 @@ export default {
this.$bus.$on('accept', this.handleAccept)
window.addEventListener('keydown', this.handleKeyboardEvent)
window.addEventListener('click', this.closePeakInfomationTooltip)
},
destroyed() {
this.cancelLastRequest()
@ -260,6 +261,7 @@ export default {
this.$bus.$off('accept', this.handleAccept)
window.removeEventListener('keydown', this.handleKeyboardEvent)
window.removeEventListener('click', this.closePeakInfomationTooltip)
},
deactivated() {
this.nuclideLibraryVisible = false
@ -272,6 +274,7 @@ export default {
//
handleKeyboardEvent(event) {
this.changeRectByKeyBoard(event.key)
this.closePeakInfomationTooltip()
},
/**
@ -1090,7 +1093,7 @@ export default {
this.peakInfomationTooltip.content = html
this.peakInfomationTooltip.visible = true
this.peakInfomationTooltip.left = xPix
this.peakInfomationTooltip.top = yPix - 20
this.peakInfomationTooltip.top = yPix < 0 ? 20 : yPix - 20
} else {
this.$message.error(message)
}