Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

PointerEvent vs MouseEvent on event handlers #13039

Discussion options

Hi all,

I was wondering about the behavior and content of event handlers like @click, @drag, @touchend, etc ...

Having <div @click="doSomething"/>, TS shows this onClick?: ((payload: MouseEvent) => void) | undefined as the function type.

Meanwhile when I console.log the event, I get a MousePointer event properties.

Is vue's event payload different from vanilla JS? or is it a TS mistake? Why this is happening?

You must be logged in to vote

Vue just passes on the object from the native event, it doesn't change it.

The type may be incorrect, I suspect this may be related: #9675.

Replies: 1 comment

Comment options

Vue just passes on the object from the native event, it doesn't change it.

The type may be incorrect, I suspect this may be related: #9675.

You must be logged in to vote
0 replies
Answer selected by aryankarim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /