2

I need to hide the select all option from a v-data-table, the vuetify component. According to the documentation including the header-prop, single-select as true should do it but is not working.

<v-data-table
v-model="selected
:headers="headers"
:items="items"
show-select
:header-props="{singleSelect:true}"
></v-data-table>
Ernesto 45
  • 21
  • 1
  • 2
  • `single-select` prop leads to disabling the ability to select multiple rows. Do you really want to achieve this behaviour? If yes, you can just apply this prop to `v-data-table` component directly – Alexander Shkirkov Feb 02 '22 at 02:17

2 Answers2

1

If you want to be able to only select one item at a time you can add single-select directly to v-data-table:

<v-data-table
  v-model="selected"
  :headers="headers"
  :items="items"
  show-select
  single-select
></v-data-table>

If you want to be able to select multiple items you can override the select all checkbox with the header.data-table-select slot:

<v-data-table
  v-model="selected"
  :headers="headers"
  :items="items"
  show-select
>
  <template #header.data-table-select></template>
</v-data-table>
Jay Fridge
  • 1,017
  • 11
  • 13
1

I use slot to overwrite the select-all.

<v-data-table
  v-model="selected"
  :headers="headers"
  :items="items"
  show-select
>
  <template v-slot:[`header.data-table-select`]></template>
</v-data-table>

and if you could put a title for sue, like this:

<v-data-table
  v-model="selected"
  :headers="headers"
  :items="items"
  show-select
>
  <template v-slot:[`header.data-table-select`]>Selected</template>
</v-data-table>