Closed
Description
<script lang="ts">
import { defineComponent, PropType, ref } from 'vue'
export default <T>() => defineComponent({
props: {
items: { type: Array as PropType<T[]>, required: true },
},
setup(props, { emit }) {
const testVar= ref(0)
return {
testVar,
}
}
})
</script>
<template>
<div>
{{ testVar /* Cannot find name 'testVar'.ts(2304) */ }}
</div>
</template>
Actually found out that this example not working (I'm using vite and vue-tsc). Is it possible to define a generic component at all?