How can I hide and show a vuetify table header? I need to show or hide a header if an object contains a particular service.
<v-data-table
style="position: relative; z-index: 0"
class="pa-0"
dense
disable-pagination
disable-sort
fixed-header
:headers="headers"
:height="height"
hide-default-footer
:items="locations"
item-key="id"
:loading="loadingDataTable"
:ref="'datatable'"
@click:row="highlightRow"
@current-items="currentItems"
calculate-widths
>
<template v-slot:item.headerHidden="{ item }">
<span class="secondary--text text-lg-caption text-xl-body-2">
{{ value }}
</span>
</template>
</v-data-table>
data() {
return {
headersMap: {
headerHidden: {
text: 'Hello
),
align: 'center',
value: 'headerHidden',
class: 'secondary--text ml-4'
},
}
}
}
And I must hide that header, depending on the existence of services3, if services3 does not exist it is hidden, if not, it is shown, the structure of the object is:
obj: {
services: {
services1: {
...
},
services2: {
...
},
services3: {
...
},
}
}
I tried with a computed property and I couldn’t solve it, also creating a watcher and I couldn’t solve it. Thank