Manually annotating prop with JSDoc doesn't produce right type
Vue version
3.2.0
Link to minimal reproduction
Steps to reproduce
- Download the code from the reproduction playground
- Install Volar in the editor
- Hover over the items in the template
What is expected?
The type of items
should be number[]
What is actually happening?
The type of items
is any
.
System Info
No response
Any additional comments?
I've also created example projects using both Vue 3 and Vue 2.7 at:
- Vue 2.7: https://github.com/rchl/volar-vue2-test/tree/vue27
- Vue 3: https://github.com/rchl/volar-vue2-test/tree/vue3
(note that those repros are on their own branches)
This is to show that this works in Vue 2.7 when annotating using the PropOptions
type (Vue 2 variant of Vue 3's Prop
type).
Also see corresponding Volar issue: https://github.com/johnsoncodehk/volar/issues/1984#issuecomment-1275161205
I've started a related discussion about JSDoc and defineProps()
macro: https://github.com/vuejs/rfcs/discussions/584