Skip to content

Commit 71983c9

Browse files
authored
Merge pull request #242 from yamachan/feature/static-table-header
Add an optional "header-static" slot to replace the DataTable's heade…
2 parents 08749be + 9463d6b commit 71983c9

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "HC200ok",
44
"description": "A customizable and easy-to-use data table component made with Vue.js 3.x.",
55
"private": false,
6-
"version": "1.5.34",
6+
"version": "1.5.35",
77
"types": "./types/main.d.ts",
88
"license": "MIT",
99
"files": [

src/components/DataTable.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
:style="getColStyle(header)"
2525
/>
2626
</colgroup>
27+
<slot
28+
v-if="slots['customize-header']"
29+
name="customize-header"
30+
/>
2731
<thead
28-
v-if="headersForRender.length && !hideHeader"
32+
v-else-if="headersForRender.length && !hideHeader"
2933
class="vue3-easy-data-table__header"
3034
:class="[headerClassName]"
3135
>

src/modes/Client.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,25 @@
4646
@update-total-items="updateTotalItems"
4747
show-index-symbol="$"
4848
>
49+
<template #customize-header>
50+
<thead class="my-static-header">
51+
<tr>
52+
<th colspan="3" rowspan="2"></th>
53+
<th colspan="4">member info</th>
54+
<th colspan="4">indicator</th>
55+
</tr>
56+
<tr>
57+
<th>name</th>
58+
<th>team</th>
59+
<th>number</th>
60+
<th>position</th>
61+
<th>height</th>
62+
<th>weight</th>
63+
<th>lastAttended</th>
64+
<th>country</th>
65+
</tr>
66+
</thead>
67+
</template>
4968
<template #expand="item">
5069
<div style="padding: 15px">
5170
{{ item.name }} won championships
@@ -343,4 +362,10 @@ const updateRowsPerPageSelect = (e: Event) => {
343362
--easy-table-loading-mask-background-color: #2d3a4f;
344363
}
345364
365+
.my-static-header th {
366+
color: white;
367+
border-right: 1px solid #445269;
368+
border-bottom: 1px solid #445269;
369+
}
370+
346371
</style>

0 commit comments

Comments
 (0)