Feature request: allow to acess to the modifier for v-on when bound to functional component
See original GitHub issueIt would be nice to share v-on
modifier for functional components to add ability to extend standard v-on
modifiers.
In simple cases we can work around of this by adding additional props to the functional component e.g. <my-comp @reset="process" modifier="hard"></my-comp>
.
But there are cases when it is very difficult to do it the same way. I believe, this feature will help with this.
As an example with this feature we can create something like input-context
component which handles input event when it is in focus:
<input-context
:focus="isFocused"
@click="isFocused = true"
@key.down="scrollDown(1)"
@wheel.down="scrollDown(3)">
...
</input-context>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
State Management within React Functional Components with ...
Your components can bind to the value of isAuthenticated. The only way to mutate the state and its binding is to call the...
Read more >Vue 3 JSX Design · Issue #141 · vuejs/jsx-vue2 - GitHub
We are using this thread to unify the design and land on an official specification of how Vue features should be handled in...
Read more >Manifest.permission - Android Developers
Allows an application to collect component usage statistics. Declaring the permission implies intention to use the API and the user of the device...
Read more >Build a web application with React and Kotlin/JS — tutorial
Build a web application with React and Kotlin/JS — tutorial. This tutorial will teach you how to build a browser application with Kotlin/JS ......
Read more >core - Apache HTTP Server Version 2.4
On: A request will be accepted if a leading path component maps to a file that ... Allow use of the directives controlling...
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
Most modifiers (except
.once
and.native
) are actually specific to native events, so they don’t really make much sense on components anyway. I think it’s best to keep component events simple and just use event name to differentiate them, since they are ultimately different events rather than the same event with different behavior.@yyx990803 hmm, you are right, probably nothing. Only it looks different from
@keyup.down
default syntax, but definitely can be used.When we define
v-on
handler on component with modifier, it will silently be ignored and event without modifier will be fired. May be we can pass raw string with modifier (e.g.key.down
) to the component event when it is not native event, or warn in dev mode what dot notation is not supported for component events. What do you think?