Closed
Description
Since the push of adding generic components on Vue 3.3.0, we don't seem able to get the InstanceType
aka public instance
anymore.
<script setup lang="ts" generic="T"> const props = withDefaults(defineProps<{ value?: T | null; list: T[]; }>(), { value: null, }); </script> <template> <select> // code </select> </template>
<script lang="ts"> import MyComp from './MyComp.vue' // This has error const el = ref<null | InstanceType<typeof MyComp<any>>>( null ) </script> <template> <my-comp ref="el" list="[]"/> </template>