Skip to content

Commit

Permalink
chore: code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 27, 2024
1 parent e40d930 commit dd2cb96
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions packages/vuetify/src/components/VDataTable/VDataTableHeaders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
'v-data-table__th--sticky': props.sticky,
},
displayClasses.value,
loaderClasses.value,
]))

const VDataTableHeaderCell = ({ column, x, y }: { column: InternalDataTableHeader, x: number, y: number }) => {
Expand All @@ -140,13 +141,12 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
tag="th"
align={ column.align }
class={[
...headerCellClasses.value,
{
'v-data-table__th--sortable': column.sortable,
'v-data-table__th--sorted': isSorted(column),
'v-data-table__th--fixed': column.fixed,
},
loaderClasses.value,
...headerCellClasses.value,
]}
style={{
width: convertToUnit(column.width),
Expand Down Expand Up @@ -231,7 +231,6 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
tag="th"
class={[
...headerCellClasses.value,
loaderClasses.value,
]}
colspan={ headers.value.length + 1 }
{ ...headerProps }
Expand Down Expand Up @@ -277,15 +276,11 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
}

useRender(() => {
if (mobile.value) {
return (
<tr>
<VDataTableMobileHeaderCell />
</tr>
)
}

return (
return mobile.value ? (
<tr>
<VDataTableMobileHeaderCell />
</tr>
) : (
<>
{ slots.headers
? slots.headers(slotProps.value)
Expand Down

0 comments on commit dd2cb96

Please sign in to comment.