Skip to content

Conversation

@prestonyford
Copy link

Description

fixes #21814
Fixes contextual defaults for components inside of VMenus that are inside VDataTables. Currently, components that are inside these such as VList and VButton do not properly get their defaults that are defined in the defaults property of Vuetify's configuration object.

Changes

  • Added { root: true } when VDataTable provides defaults

Markup:

In my local development environment I set my defaults to:

VDataTable: {
  VMenu: {
    VBtn: {
      density: 'compact',
      variant: 'outlined'
    },
    VList: {
      density: 'compact',
      VBtn: {
        variant: 'plain'
      }
    }
  }
}

And my playground:

<template>
  <v-app>
    <v-data-table :items="[{ name: 'name1', please: 'Click me' }, { name: 'name2', please: 'Click me' }]"
      :disable-sort="true">
      <template v-slot:item="{ index, item }">
        <tr>
          <td>{{ item.name }}</td>
          <td>
            <v-menu>
              <template v-slot:activator="{ props }">
                <v-btn v-bind="props">{{ item.please }}</v-btn>
              </template>
              <v-list>
                <v-list-item>
                  <v-btn>ListButton 1</v-btn>
                  <v-btn>ListButton 2</v-btn>
                </v-list-item>
              </v-list>
            </v-menu>
          </td>
        </tr>
      </template>
    </v-data-table>
  </v-app>
</template>

<script>
export default {
  name: 'Playground',
  setup() {
    return {
      //
    }
  },
  data() {
    return {
    }
  }
}
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.9.0] Contextual defaults for VList and VButton inside VDataTable

1 participant