I’m really confused by “:item-class” prop in Vuetify (v. 2.3.4) data table. It does nothing even if I try to add a static text class.
JavaScript
x
12
12
1
<v-data-table class="mt-10"
2
item-key="id"
3
:headers="headers"
4
:items="user_tender_assignment_table.user_tender_assignments"
5
:loading="user_tender_assignment_table.loading"
6
:loading-text="tables.loading_text"
7
:search="user_tender_assignment_table.search"
8
v-model="user_tender_assignment_table.selected"
9
:footer-props="tables.footer_props"
10
:item-class="'xxx'"
11
</v-data-table>
12
It just renders tr
tags without any class:
Do you know why? I think it worked some time ago and I haven’t changed Vuetify (2) version.
Advertisement
Answer
item-class
does not specify the CSS classes directly. If it is a String – then it specifies the property inside the item’s Object which contains the CSS class(es). If it is a Function – then it gets the item
as its argument and must return the CSS class(es).