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

camelCase prop names not converting to kebab-case when using defineComponent with function signature #10651

Closed
CernyMatej opened this issue Apr 5, 2024 · 2 comments

Comments

@CernyMatej
Copy link

CernyMatej commented Apr 5, 2024

Vue version

3.4.21

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-uxfxn6?file=src%2FApp.vue,package.json&terminal=dev

Steps to reproduce

When defining a component using defineComponent with the new function signature, prop types are not generated with kebab-case names. This results in a type error when using the component in the template with kebab-case props.

Steps to reproduce:

  1. Open the reproduction.
  2. Run vue-tsc in the terminal.

What is expected?

No type error should be raised when the component props in the template are defined using kebab-case.

What is actually happening?

An error is being raised:

src/App.vue:38:6 - error TS2345: Argument of type '{ "aria-label": string; }' is not assignable to parameter of type '{ ariaLabel: string; } & VNodeProps & AllowedComponentProps & ComponentCustomProps & Record<string, unknown>'.
  Property 'ariaLabel' is missing in type '{ "aria-label": string; }' but required in type '{ ariaLabel: string; }'.

System Info

No response

Any additional comments?

No response

@edison1105
Copy link
Member

duplicate of #10634

@CernyMatej
Copy link
Author

Didn't realize it was a problem with only aria- attributes. Linking vuejs/language-tools#4219 then... 👍

@github-actions github-actions bot locked and limited conversation to collaborators Apr 21, 2024
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