Skip to content

[Feature] Mouse event listener modifiers #3050

@edjroot

Description

@edjroot

First of all, I'd like to thank everyone who has contributed to this absolutely wonderful library.

I was reading the docs on key modifiers (for example, @keyup.enter) and was wondering if it would be worth having the same kind of thing for mouse buttons. This would make handling much simpler since the same events that are available for the left button by default would be for the other ones as well without the need for repetitive checking in the JS code.

For instance:

<button @click.left="hello" @click.right="bye">Say hello or bye</button>
<div @mousedown.middle="drag">I'm draggable!</div>

The only possible "downside", I guess, is that @click.right would become a synonym for @contextmenu, but it doesn't sound that bad.

Is this viable?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions