Skip to content

Commit 336f302

Browse files
Fix issue with header color not workign on sortable columns
1 parent abfbc45 commit 336f302

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/plugin/slots/HeadersSlot.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@
5858
:style="cellStyles(column)"
5959
@click="sortColumn(column as InternalDataTableHeader)"
6060
>
61-
<div :class="cellAlignClasses(column.align as keyof Column)">
61+
<div
62+
:class="cellAlignClasses(column.align as keyof Column)"
63+
:style="cellChildStyles(column)"
64+
>
6265
<span v-html="renderCell(column)"></span>
6366

6467
<template v-if="column.sortable && slots[`header.sortIcon`]">
@@ -221,6 +224,17 @@ const cellStyles = (column: { width?: string | number; }, dataTableExpand = fals
221224
});
222225
};
223226
227+
const cellChildStyles = (column: Column): CSSProperties => {
228+
const cellStyle = cellStyles(column);
229+
230+
231+
if (typeof props.headerColor === 'undefined') {
232+
return {};
233+
}
234+
235+
return { color: cellStyle.color };
236+
};
237+
224238
225239
// -------------------------------------------------- Select //
226240
const isIndeterminate = computed(() => {

0 commit comments

Comments
 (0)