Skip to main content
InterviewHubPRO
Section Overview
Q33

Question 33 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

66%
Vue.js & Composition API (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

TypeScript Generics in `<script setup lang="ts">`.

senior LevelCode ExampleTypeScriptSystem Design

In Simple Words: Generic components (e.g. a reusable <DataTable<T>>):

vue
<script setup lang="ts" generic="T extends { id: string }">
defineProps<{
  items: T[];
  selected: T;
}>();
</script>