Open
Description
Vue version
3.4.8
Link to minimal reproduction
Steps to reproduce
- In the file
App.vue
, notice how TypeScript complains that the functiongetItemAtIndex
(which is exposed by the generic componentOrderedList.vue
) doesn't exist in the component instance, which is typed using theComponentInstance
type added in Vue 3.4.
What is expected?
ComponentInstance
type should include exposed component methods in type.
What is actually happening?
ComponentInstance
type doesn't include exposed component methods in type when working with generic components, so TypeScript complains that there is an error when trying to access them.
System Info
No response
Any additional comments?
I'm aware that there is a type ComponentExposed
in the package vue-component-type-helpers
that allows typing generic component instances, but I think ComponenteInstance
should also consider this use case when working with generics so that there is no need to rely on external packages.