vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

fix(VDataTable): sort with extracted column values

Open xdavidwu opened this issue 2 years ago • 0 comments

Description

Fix sorting when using functions as value in column definition by using parsed columns in DataTableItem. To be compatible with VDataIterator which shares the useSortedItems composable, old .raw behavior is preserved if there is no .columns.

Markup:

<template>
  <v-app>
    <v-container>
      <v-data-table :items="items" :headers="headers" />
    </v-container>
  </v-app>
</template>

<script>
  export default {
    name: 'Playground',
    setup () {
      return {
        items: [
          { string: 'foo' },
          { string: 'bar' },
        ],
        headers: [
          { key: 'foobar', title: 'String', value: v => v.string },
        ],
      }
    },
  }
</script>

xdavidwu avatar Nov 16 '23 11:11 xdavidwu