Subscribe on changes!

Cannot listen to kebab-case events

avatar
Oct 24th 2020

Version

3.0.2

Reproduction link

https://codesandbox.io/s/laughing-merkle-esils?file=/src/components/HelloWorld.vue

Steps to reproduce

  • Listen to a kebab-case event (@my-event="listener")
  • Emit the event (emit("my-event"))
  • The event is not received

What is expected?

Kebab-case events should be listenable and preferred, as per the docs

What is actually happening?

My understanding is that #2278 normalizes all event listeners to pascal-casing, making it impossible to listen to kebab-case events.

In fact, binding with @myEvent="listener" works with both emit("my-event") and emit("myEvent").


I ran into this bug because of an issue posted to my library, in which my kebab-case listeners were not being triggered.

avatar
Oct 24th 2020

https://github.com/vuejs/vue-next/issues/2429 already reported this, my bad