Skip to content

Events are not hypenated #2669

@paulpflug

Description

@paulpflug

Vue.js version

1.0.21

Reproduction Link

https://jsfiddle.net/paulpflug/5sH6A/312/

Steps to reproduce

// in component
this.$emit("testTest") // camelCase
// outside
<comp @test-test="test"></comp>

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:

case $emit $on in code v-on in attributes
1 camelCase camelCase not possible
2 lowercase lowercase lowercase /camelCase
3 hypenated hypenated hypenated

I think this makes more sense:

case $emit $on in code v-on in attributes
1 camelCase camelCase hypenated
2 lowercase lowercase lowercase /camelCase
3 warn to use camelCase warn to use camelCase hypenated

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions