v-on dynamic argument doesn't work with .native modifier
See original GitHub issueVersion
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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Vue.js dynamic directive argument not working - Stack Overflow
The workaround is to either use expressions without spaces or quotes, or replace the complex expression with a computed property. Also camelCase ...
Read more >Event Handling - Vue.js
Order matters when using modifiers because the relevant code is generated in the same order. Therefore using v-on:click.
Read more >TSConfig Reference - Docs on every TSConfig option
If a glob pattern doesn't include a file extension, then only files with supported extensions are included (e.g. .ts , .tsx , and...
Read more >Announcing TypeScript 4.7 Beta - Microsoft Developer Blogs
One issue with the introduction of modules to JavaScript was the ambiguity between existing "script" code and the new module code.
Read more >Dynamic Argument Structure - ACL Anthology
This paper presents a new classification of verbs of change and modification, proposing a dynamic interpretation of the lexical semantics of the predicate ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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)
Directive arguments and modifiers are separate concepts. Argument is the part after
v-xxx:
and before any modifiers. Modifiers always start with a.
. The dynamic arguments feature in 2.6 applies only to the argument, not modifiers.