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

feat(VDataTableHeaders): add mobile headers #19743

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

webdevnerdstuff
Copy link
Contributor

@webdevnerdstuff webdevnerdstuff commented May 3, 2024

Description

  • Adding mobile.header slot
  • Moving thead to VDataTableHeaders
  • Moving thead slot to VDataTableHeaders
  • Update logic for showing mobile sortby
  • Update logic for showing moibile select all checkbox

related:
#19749
#19730

Markup:

<template>
  <v-data-table
    :headers="headers"
    :items="desserts"
    :mobile="true"
    item-value="name"
    items-per-page="5"
    page="1"
    theme="dark"
  />
<!-- <template #[`mobile.header`]="props">
  <v-checkbox
    v-model="props.allSelected"
    :indeterminate="props.someSelected && !props.allSelected"
    hide-details
    @update:model-value="props.selectAll"
  />
</template> -->
</template>

<script setup lang="ts">
  import { ref } from 'vue'

  const headers = ref([
    {
      title: 'Dessert (100g serving)',
      align: 'start',
      sortable: false,
      key: 'name',
    },
    {
      title: 'Calories',
      key: 'calories',
      sortable: false,
    },
    {
      title: 'Fat (g)',
      key: 'fat',
      // sortable: false,
    },
  ] as const)
  const desserts = ref([
    {
      name: 'Frozen Yogurt',
      calories: 159,
      fat: 6,
    },
    {
      name: 'Ice cream sandwich with some really long name',
      calories: 237,
      fat: 9,
    },
    {
      name: 'Eclair',
      calories: 262,
      fat: 16,
    },
    {
      name: 'Cupcake',
      calories: 305,
      fat: 3.7,
    },
    {
      name: 'Gingerbread',
      calories: 356,
      fat: 16,
    },
    {
      name: 'Jelly bean',
      calories: 375,
      fat: 0,
    },
    {
      name: 'Lollipop',
      calories: 392,
      fat: 0.2,
    },
    {
      name: 'Honeycomb',
      calories: 408,
      fat: 3.2,
    },
    {
      name: 'Donut',
      calories: 452,
      fat: 25,
    },
    {
      name: 'KitKat',
      calories: 518,
      fat: 26,
    },
  ])
</script>

@johnleider johnleider changed the base branch from master to dev May 3, 2024 02:25
@MajesticPotatoe MajesticPotatoe added T: feature A new feature C: VDataTable VDatatable labels May 7, 2024
@MajesticPotatoe MajesticPotatoe changed the title Feat/data table mobile header feat(VDataTableHeaders): add mobile headers May 7, 2024
@webdevnerdstuff webdevnerdstuff marked this pull request as ready for review May 11, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable VDatatable T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants