According to the information found at https://v2.vuejs.org/v2/guide/events.html#exact-Modifier, I am attempting to build an element that triggers different methods based on additional keys pressed at the time of clicking.
<span @click.exact="method1"
@click.shift.exact="method2"
@click.alt.exact="method3"
>Click me with or without modifiers</span>
When clicking on the text, method1
is triggered. However, there seems to be an issue where method1
is executed before method2
when SHIFT + Click and before method3
when ALT + Click. The desired behavior is for method1
to only execute on a plain click without any modifier keys being pressed.
Edit: Initially I mentioned using Version 2.5 of Vue, but it appears that the linked version is 2.3, which does not include the "exact" feature.
You can view the complete example codepen here: https://codepen.io/anon/pen/bjKRzV