DevonDahon
DevonDahon

Reputation: 8360

How to set a class to a <v-data-table> column with Vuetify?

How to set a class to a column with Vuetify data table ?

I have tried to set it in the template, but it's not taken into account:

<template v-slot:item.code="{ item }" class="primary">
  {{ item.code }}
</template>

I also tried to set it from the headers property, but only the header cell is set:

headers: [
  {value: "code", class:['primary']},
  {...}
]

Upvotes: 0

Views: 859

Answers (1)

M3HDI
M3HDI

Reputation: 327

try this :

<template v-slot:item.code="{ item }">
<div class="primary">
{{ item.code }}
</div>
  
</template>

Upvotes: 1

Related Questions