-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
v-on dynamic argument doesn't work with .native modifier #9417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The modifier is NOT part of the event's name/argument. The proper syntax is Same reason that |
nvm, |
Oh okay, thanks, I thought I might have misunderstood the syntax but I couldn't think of any other way to bind it (and it hasn't been documented yet right? unless I missed it). I had tried to treat it like a property access initially by doing Also it's only one level deep right, they can't be chained like And is the reason |
Directive arguments and modifiers are separate concepts. Argument is the part after |
hey @yyx990803, how can I use @[condition].native here in this codition where one condition has a modifier (v-on:keyup.enter) and another has no modifier(v-on:change)
|
Version
2.6.0
Reproduction link
https://codesandbox.io/s/r749jp21o4
Steps to reproduce
I made a simple button component which does not emit any events. In the app there are three instances of it with the
@click.native
event bound in different way.You can see the first button component which was bound with
@click.native
works and increases the counter, but the rest which use v-on and the new conditional binding syntax do not.I thought it might have been some limitation of native events but this also happens with other modifiers, like
keydown.somekey
.What is expected?
The events should be bound and all the buttons should work.
What is actually happening?
The buttons do not work. The events are not bound. Only the first button actually gets a listener attached when I inspect them with chrome's devtools.
The text was updated successfully, but these errors were encountered: