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(VDataTableVirtual): add missing colgroup slot #19052

Conversation

jaketig
Copy link
Contributor

@jaketig jaketig commented Jan 15, 2024

Description

Adds missing colgroup slot to the virtual data table that is present in the basic and server data tables.

Markup:

<template>
  <v-app>
    <v-container>
      <v-data-table-virtual
        :headers="headers"
        :items="virtualBoats"
        height="400"
        item-value="name"
      >
        <template #colgroup="{}">
          <colgroup>
            <col style="background: red;">
            <col style="background: green;">
            <col style="background: blue;">
            <col style="background: pink;">
            <col style="background: yellow;">
          </colgroup>
        </template>
      </v-data-table-virtual>
    </v-container>
  </v-app>
</template>

<script>
  export default {
    data () {
      return {
        headers: [
          { title: 'Boat Type', align: 'start', key: 'name' },
          { title: 'Speed (knots)', align: 'end', key: 'speed' },
          { title: 'Length (m)', align: 'end', key: 'length' },
          { title: 'Price ($)', align: 'end', key: 'price' },
          { title: 'Year', align: 'end', key: 'year' },
        ],
        boats: [
          {
            name: 'Speedster',
            speed: 35,
            length: 22,
            price: 300000,
            year: 2021,
          },
          {
            name: 'OceanMaster',
            speed: 25,
            length: 35,
            price: 500000,
            year: 2020,
          },
          {
            name: 'Voyager',
            speed: 20,
            length: 45,
            price: 700000,
            year: 2019,
          },
          {
            name: 'WaveRunner',
            speed: 40,
            length: 19,
            price: 250000,
            year: 2022,
          },
          {
            name: 'SeaBreeze',
            speed: 28,
            length: 31,
            price: 450000,
            year: 2018,
          },
          {
            name: 'HarborGuard',
            speed: 18,
            length: 50,
            price: 800000,
            year: 2017,
          },
          {
            name: 'SlickFin',
            speed: 33,
            length: 24,
            price: 350000,
            year: 2021,
          },
          {
            name: 'StormBreaker',
            speed: 22,
            length: 38,
            price: 600000,
            year: 2020,
          },
          {
            name: 'WindSail',
            speed: 15,
            length: 55,
            price: 900000,
            year: 2019,
          },
          {
            name: 'FastTide',
            speed: 37,
            length: 20,
            price: 280000,
            year: 2022,
          },
        ],
      }
    },
    computed: {
      virtualBoats () {
        return [...Array(10000).keys()].map(i => {
          const boat = { ...this.boats[i % this.boats.length] }
          boat.name = `${boat.name} #${i}`
          return boat
        })
      },
    },
  }
</script>

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VDataTableVirtual labels Jan 16, 2024
@johnleider johnleider added this to the v3.4.x milestone Jan 17, 2024
@johnleider johnleider merged commit 0dca210 into vuetifyjs:dev Jan 17, 2024
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTableVirtual 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