vuetify
vuetify copied to clipboard
fix(VDataTable): sort with extracted column values
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>