vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Home Page:https://vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  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

duplicate of #10634

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