Needs #16934
People generally recognize it as <script setup lang="ts" generic="T">. But, as Quasar components are not SFCs, nor written in TypeScript, introducing generics is different. We have to start manually authoring TS files, and then add generics on top, which requires #16934.
Adding this feature would allow components like QSelect, QTable, etc. to have type-safety, autocomplete, etc. in their certain props and slots. Here is an example:
<template>
<q-select
:options="options"
:option-value="option => option.id"
option-label="name"
/>
<!-- ^^^ `name` doesn't have auto-complete, `option` is seen as any -->
<!-- With the addition of generics, both props will be aware of the type of `options` -->
</template>
<script setup lang="ts">
const options = [
{ id: 1, name: 'test' }
];
</script>
Needs #16934
People generally recognize it as
<script setup lang="ts" generic="T">. But, as Quasar components are not SFCs, nor written in TypeScript, introducing generics is different. We have to start manually authoring TS files, and then add generics on top, which requires #16934.Adding this feature would allow components like QSelect, QTable, etc. to have type-safety, autocomplete, etc. in their certain props and slots. Here is an example: