fix: 点击页面任意位置时关闭Peak Infomation Tooltip
This commit is contained in:
parent
53f0c25cdd
commit
6a3f99177b
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user