Get original item in v-data-table(-server) slot? #17028
-
For a I put a breakpoint to see what is actually passed to the slot. Here's a screenshot of what's passed for a I can see that the data is duplicated in five places: For a In this case the data is duplicated in three places: So what's the proper way to get the original item that, ideally, works for both Here's a snippet of my code: <template>
<v-card>
<v-card-title>{{ t('title') }}</v-card-title>
<v-card-text>
<v-data-table-server
v-model:page="page"
v-model:items-per-page="pageSize"
:headers="headers"
:items="items"
:items-length="total"
@update:options="fetch"
>
<template #item.transaction_date="{item}">
{{
(() => {
debugger
})()
}}
{{ truncateDate(item.raw.transaction_date) }}
</template>
</v-data-table-server>
</v-card-text>
</v-card>
</template> [1] https://vuetifyjs.com/en/components/data-tables/basics/#item |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
InternalItem needs to be split up into separate interfaces for selects and tables, |
Beta Was this translation helpful? Give feedback.
InternalItem needs to be split up into separate interfaces for selects and tables,
item.title
anditem.props
don't really make sense for tables. The original item will always be underitem.raw
though.