Open rchl opened 2 years ago
3.2.0
https://sfc.vuejs.org/#eNpNUMtuwjAQ/JWVL4Eo2Gp7i9yoHHvrHXMIZGmDsGPZDgVZ/veuE5Tii/cxOzO7kW2t5dcRWc1kQG0vbcBGGQDZ9dcmRuip6iElKXJBGSmeYJT6o+ttoBhvdnABOjy14yVAzCSm1VhD8Wk6vBVVrlg3WF/PXQBRlvAR7hYh9jqPrwryUqz5F8GkGfUB3W5fwe6lgtcK3vZNglLMs5OxhQkg09Swda69T0r5PczUsFrDe/NPM/dT/hKBKZBiWYRVbDaz0a3lZz8YOs4kox4Nr9girBg5zrliPyHQbkL40zGf9Oz54L4FRdyNJvQaOXq9Objh16MjYsUmA6TP0h/G+3+V
The type of items should be number[]
items
number[]
The type of items is any.
any
No response
I've also created example projects using both Vue 3 and Vue 2.7 at:
(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).
PropOptions
Prop
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
defineProps()
Vue version
3.2.0
Link to minimal reproduction
https://sfc.vuejs.org/#eNpNUMtuwjAQ/JWVL4Eo2Gp7i9yoHHvrHXMIZGmDsGPZDgVZ/veuE5Tii/cxOzO7kW2t5dcRWc1kQG0vbcBGGQDZ9dcmRuip6iElKXJBGSmeYJT6o+ttoBhvdnABOjy14yVAzCSm1VhD8Wk6vBVVrlg3WF/PXQBRlvAR7hYh9jqPrwryUqz5F8GkGfUB3W5fwe6lgtcK3vZNglLMs5OxhQkg09Swda69T0r5PczUsFrDe/NPM/dT/hKBKZBiWYRVbDaz0a3lZz8YOs4kox4Nr9girBg5zrliPyHQbkL40zGf9Oz54L4FRdyNJvQaOXq9Objh16MjYsUmA6TP0h/G+3+V
Steps to reproduce
What is expected?
The type of
items
should benumber[]
What is actually happening?
The type of
items
isany
.System Info
No response
Any additional comments?
I've also created example projects using both Vue 3 and Vue 2.7 at:
(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'sProp
type).Also see corresponding Volar issue: https://github.com/johnsoncodehk/volar/issues/1984#issuecomment-1275161205