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

Component events are transformed to camelCase #2638

Closed
biesbjerg opened this issue Nov 19, 2020 · 1 comment
Closed

Component events are transformed to camelCase #2638

biesbjerg opened this issue Nov 19, 2020 · 1 comment

Comments

@biesbjerg
Copy link

Version

3.0.2

Steps to reproduce

It is recommended to emit kebab-case events from components (per v3 docs and eslint vue/custom-event-name-casing rule).

The component:

export default defineComponent({
  name: "ResultsBar",
  emits: ["select-result"]
});

This is how it is used in a component:

<ResultsBar @select-result="onSelectResult($event)" />

It seems event names are transformed to camelCase before reaching the component, resulting in an error:

Extraneous non-emits event listeners (selectResult) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.

What is expected?

Event name should be kept as is camelCase

What is actually happening?

Event name is transformed to camelCase

@biesbjerg biesbjerg changed the title Component event is transformed to kebabCase Component events are transformed to camelCase Nov 19, 2020
@posva
Copy link
Member

posva commented Nov 19, 2020

Duplicate of #2540


Please, search existing issues and pull requests before opening issues, it saves maintainers a lot of time 🙏

@posva posva closed this as completed Nov 19, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants