-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Events are not hypenated #2669
Comments
The current suggestion is simply avoid using camelCase event names, because there's no particular reason to do it. |
In my app I followed |
I have three arguments:
events:
someEvent: -> # allowed without qoutes
<comp :some-prop="someThing"></comp>
# vs.
<comp @some-event="someThing"></comp> props:
someProp: {}
# vs.
events:
someEvent: -> # only that this currently won't work
|
fwiw, I'm kind of 50/50 on this. thoughts:
|
Readability. It helps to distinguish events from methods. And usually, events are more human readable: |
@azamat-sharapov - that's a good point. |
I oppose, the usage pattern for events and methods is totally different. I can think of no way to confuse the both. events: {
doStuff: doStuff
}
// or
this.$on('doStuff',this.doStuff)
// both look super clean to me.. |
I usually try to emphasize the difference between events and methods. An event doesn't necessarily carry any information about what is needed to react to it. For example, a cancel button of a form within an overlay dispatches an event that I'd call |
So to conclude:
another suggestion: |
Vue.js version
1.0.21
Reproduction Link
https://jsfiddle.net/paulpflug/5sH6A/312/
Steps to reproduce
What is Expected?
Event should be called
What is actually happening?
Event isn't called
This is a bit delicate.
When working with attributes it is totally clear to expect the same behavior as
props
.current behavior:
I think this makes more sense:
The text was updated successfully, but these errors were encountered: