Skip to content
Discussion options

You must be logged in to vote

First of all, props in #body="props" is just a naming choice. It doesn't actually contain the columns. So, QTableProps is not the correct type to use there.

You can use something like this:

<template>
  ...
  <template #body="scope: BodyScope">
  </template>
  ...
</template>

<script lang="ts" setup>
import { QTableSlots } from 'quasar';

interface BodyScope<T = any> extends Parameters<QTableSlots["body"]>[0] {
  row: T;
}
</script>

We are planning to add generic to all component types: #16935
So, when that is done, you will be able to automatically get the correct value with just #body="scope", without doing anything extra. But, for now, you can use the way I provided above.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RamonDonadeu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants