Javascript 如何过滤出鼠标点击释放事件?

Javascript 如何过滤出鼠标点击释放事件?,javascript,vue.js,events,dom-events,vuetify.js,Javascript,Vue.js,Events,Dom Events,Vuetify.js,我有一个Vue/Vuetify对话框,在对话框外单击即可关闭(如预期的那样) 问题: 在该对话框中,我有一个文本字段。如果我现在选择了内容,并且(无意中)将鼠标释放到对话框外,它将关闭。我想数以百计的用户将会遇到这个问题 下面是一个显示问题的小gif: 我为click:outside编写了一个处理程序并记录了事件,它是: altKey: false bubbles: true button: 0 buttons: 0 cancelBubble: false cancelable: true c

我有一个Vue/Vuetify对话框,在对话框外单击即可关闭(如预期的那样)

问题: 在该对话框中,我有一个文本字段。如果我现在选择了内容,并且(无意中)将鼠标释放到对话框外,它将关闭。我想数以百计的用户将会遇到这个问题

下面是一个显示问题的小gif:

我为click:outside编写了一个处理程序并记录了事件,它是:

altKey: false
bubbles: true
button: 0
buttons: 0
cancelBubble: false
cancelable: true
clientX: 398
clientY: 358
composed: true
ctrlKey: false
currentTarget: null
defaultPrevented: true
detail: 1
eventPhase: 0
fromElement: null
isTrusted: true
layerX: 292
layerY: 4
metaKey: false
movementX: 0
movementY: 0
offsetX: 292
offsetY: 4
pageX: 398
pageY: 358
path: (19) [label.v-label.theme--light, div.v-input__slot, div.v-input__control, div.v-input.v-input--is-label-active.v-input--is-dirty.theme--light.v-input--selection-controls.v-i…, div.card-content.grid-x, div.v-card.v-card--flat.v-sheet.theme--light, div.no-padding-horizontal.col-sm-12.col-md-12.col-lg-12.col-xl-12.col, div.row, div.col, div.row.page-content, div.container, div.v-content__wrap, main.v-content, div.v-application--wrap, div#app.v-application.v-application--is-ltr.theme--light.page-xl.section-exchange, body, html.sr, document, Window]
relatedTarget: null
returnValue: false
screenX: 398
screenY: 430
shiftKey: false
sourceCapabilities: InputDeviceCapabilities {firesTouchEvents: false}
srcElement: label.v-label.theme--light
target: label.v-label.theme--light
timeStamp: 181260.08999999613
toElement: label.v-label.theme--light
type: "click"
view: Window {parent: Window, opener: null, top: Window, length: 0, frames: Window, …}
which: 1
x: 398
y: 358
__proto__: MouseEvent
换句话说,这是一个“点击”事件。 当然,我希望它在真实的点击下关闭。 但我不想让它在鼠标释放时关闭

有没有办法检测到这个特殊事件


感谢您的帮助:)

您可以通过在您的
中处理您正在使用的容器内的
鼠标指针
鼠标下移
鼠标下移
事件(可能是v卡?)来实现此功能。您的意思是“鼠标向上”吗?可能,我不知道。就像我说的,它注册为“点击”,你可以将它绑定到mousedown而不是click,这可能会有帮助。@TKoL好主意!但它似乎不起作用。我将
@click:outside
更改为
@mousedown:outside
,但这是相同的行为。也许这是vuetify固有的东西?
<v-card ... 
  @mouseenter="noClickAnimation = false" 
  @mousedown="noClickAnimation = true" 
  @mouseup="noClickAnimation = false"