camelCase prop names not converting to kebab-case when using `defineComponent` with function signature
CernyMatej opened this issue · comments
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:
- Open the reproduction.
- 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
Didn't realize it was a problem with only aria-
attributes. Linking vuejs/language-tools#4219 then... 👍