Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VDataTableRow): provide correct defaults for special slots #21071

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

johnleider
Copy link
Member

When using the special item.data-table-select and item.data-table-expand slots, would always return at:

image

and never actually get to the code that called slots['item.data-table-expand'] or select.

Since I was fixing that, I brought the slots in line with how we handle defaults in other components, so that you can actually modify these with relative ease now.

Description

Markup:

<template>
  <v-container class="pa-md-12">
    <v-data-table :items="items" show-expand show-select>
      <template #item.data-table-select="{ props: selectProps }">
        <v-checkbox-btn v-bind="selectProps" />
      </template>

      <template #item.data-table-expand="{ props: expandProps }">
        <v-btn v-bind="expandProps" />
      </template>

      <template #expanded-row="{ columns, item }">
        <tr>
          <td :colspan="columns.length">
            I'm expanded for item {{ item.id }}!
          </td>
        </tr>
      </template>
    </v-data-table>
  </v-container>
</template>

<script setup>
  const items = [
    { id: 'John', age: 42 },
    { id: 'Jane', age: 36 },
    { id: 'Joe', age: 30 },
  ]
</script>

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VDataTable labels Mar 6, 2025
@johnleider johnleider added this to the v3.7.x milestone Mar 6, 2025
@johnleider johnleider self-assigned this Mar 6, 2025
KaelWD added 2 commits March 6, 2025 16:17
we don't want people relying on anything but v-bind="props"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants