Prop types not showing correctly in template when using different casing in template and defineProps?
See original GitHub issueNot sure if it’s just me, but I have this issue where if I define a prop with camelCase, and then I assign a value in the template of the parent component using kebab-case, hovering over the attribute will show the type of my input instead of the type of the actual prop. Using camelCase instead will show the correct typing on hover.
Child Component (tried using type declaration, runtime declaration and non script setup method with defineComponent
)
Parent Component:
On v0.31.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Props typing in Vue.js 3 with TypeScript - Stack Overflow
1. What about if props type is array? · 2. @FarhodNematov it should be type: Array as PropType<FlashInterface[]>, or type: Array as PropType< ......
Read more >Defining Props in React Function Component with Typescript
This guide will provide you with the syntax you need to properly define the props entering your components, compare and contrast defining ...
Read more >How to Use Props in Vue.js - freeCodeCamp
We use props to pass information/data from a parent component to child components. In this article, I will explain everything you need to ......
Read more >TypeScript with Composition API - Vue.js
In this case, our second example compiles into the exact same runtime options as the first ... We can also move the props...
Read more >Typechecking With PropTypes - React
In this example, we're using PropTypes.string . When an invalid value is provided for a prop, a warning will be shown in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now we show both casing hover info.
For go further use case you can setting
vueCompilerOptions.strictTemplates = true
, it only allow define prop as camelCase so that avoid this problem.@jacobprudhomme unfortunately
snake_case
is currently intentionally not supported, because it will makes type computation and codegen more complicate.