Skip to content
Advertisement

Vuetify data table :item-class doesn’t do anything

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.

<v-data-table class="mt-10"
                      item-key="id"
                      :headers="headers"
                      :items="user_tender_assignment_table.user_tender_assignments"
                      :loading="user_tender_assignment_table.loading"
                      :loading-text="tables.loading_text"
                      :search="user_tender_assignment_table.search"
                      v-model="user_tender_assignment_table.selected"
                      :footer-props="tables.footer_props"
                      :item-class="'xxx'"
</v-data-table>

It just renders tr tags without any class:

enter image description here

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).

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement