Skip to content

Commit 575a792

Browse files
committed
feat: Add tableBodyStartInjection prop to ResourceListTable for custom component rendering
1 parent bf837ee commit 575a792

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

adminforth/spa/src/components/ResourceListTable.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<table v-else class=" w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
1515

1616
<tbody>
17-
17+
<tr v-for="c in tableBodyStartInjection" :key="c.id">
18+
<td :colspan="resource?.columns.length + 2">
19+
<component :is="getCustomComponent(c)" :meta="c.meta" :resource="resource" :adminUser="coreStore.adminUser" />
20+
</td>
21+
</tr>
1822
<!-- table header -->
1923
<tr class="t-header sticky z-10 top-0 text-xs bg-lightListTableHeading dark:bg-darkListTableHeading dark:text-gray-400">
2024
<td scope="col" class="p-4">
@@ -322,6 +326,7 @@ const props = defineProps<{
322326
sort: any[],
323327
noRoundings?: boolean,
324328
customActionsInjection?: any[],
329+
tableBodyStartInjection?: any[],
325330
}>();
326331
327332
// emits, update page

adminforth/spa/src/views/ListView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
:totalRows="totalRows"
115115
:checkboxes="checkboxes"
116116
:customActionsInjection="coreStore.resourceOptions?.pageInjections?.list?.customActionIcons"
117+
:tableBodyStartInjection="coreStore.resourceOptions?.pageInjections?.list?.tableBodyStart"
117118
/>
118119

119120
<component

0 commit comments

Comments
 (0)