Skip to content
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

Custom events: <child v-on:child-msg="handleIt"></child> #3098

Closed
gkiely opened this issue Jun 18, 2016 · 3 comments
Closed

Custom events: <child v-on:child-msg="handleIt"></child> #3098

gkiely opened this issue Jun 18, 2016 · 3 comments

Comments

@gkiely
Copy link

gkiely commented Jun 18, 2016

Vue.js version

1.0.25

Reproduction Link

https://jsfiddle.net/oL5qyky9/

Steps to reproduce

Press the dispatch event button

What is Expected?

alert('handled it')

What is actually happening?

alert('handleIt did not run');

Once you change it from childMsg back to child-msg it behaves as expected.

@marceloadsj
Copy link

marceloadsj commented Jun 18, 2016

Removing the 'events obj' from parent did the trick:

https://jsfiddle.net/oL5qyky9/2/

I think that the events obj with 'child-msg' key was 'overwriting' the method bind in template.

@yyx990803
Copy link
Member

Because you changed child-msg in the example to childMsg. Note when using v-on in the template, the event name will be turned into lowercase by the browser. This is part of the 1.x template parsing restrictions, so avoid using uppercase letters in event names in 1.x.

2.0 doesn't have this limitation.

@gkiely
Copy link
Author

gkiely commented Jun 18, 2016

Ahh that makes sense. Thanks guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants