data table vuetify code example
Example 1: vuetify sum table data
sumField(key) {
// sum data in given key (property)
let total = 0
const sum = this.goldlineup.reduce((accumulator, currentValue) => {
return (total += +currentValue[key])
}, 0)
return sum
},
Example 2: how to use in vuetify v-data-table
<template v-slot:item="{ item }">
<tr :class="{active: group && item.id == group.id}">
<td>{{ item.name }}</td>
<td>{{ item.grade }}</td>
</tr>
</template>