Skip to content

Commit

Permalink
feat(VDataTableHeaders): add support for select all
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 28, 2024
1 parent 9c70f65 commit 1d206d5
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -226,6 +226,10 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
return columns.value.filter(column => column?.sortable)
})

const appendIcon = computed(() => {
return allSelected.value ? '$checkboxOn' : someSelected.value ? '$checkboxIndeterminate' : '$checkboxOff'
})

return (
<VDataTableColumn
tag="th"
Expand All @@ -246,6 +250,8 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
multiple={ props.multiSort }
variant="underlined"
onClick:clear={ () => sortBy.value = [] }
appendIcon={ appendIcon.value }
onClick:append={ () => selectAll(!allSelected.value) }
>
{{
...slots,
Expand Down

0 comments on commit 1d206d5

Please sign in to comment.