Skip to content

Commit fc52dfd

Browse files
committed
Merge branch 'main' of github.com:devforth/adminforth into main
2 parents e0c85c4 + 710b15d commit fc52dfd

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
89
## [v1.5.9] - next
910

1011
### Changed
@@ -13,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1314

1415
### Fixed
1516
- show hook is now called as it was when user edits the page
17+
- fixed showRow in ShowTable.vue
1618

1719
## [v1.5.8]
1820

adminforth/spa/src/components/ShowTable.vue

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,34 @@
2020
:key="column.name"
2121
class="bg-lightForm bg-darkForm odd:dark:bg-gray-900 even:dark:bg-gray-800 dark:border-gray-700 block md:table-row"
2222
>
23-
<td class="px-6 py-4 relative block md:table-cell font-bold md:font-normal pb-0 md:pb-4">
24-
{{ column.label }}
25-
</td>
26-
<td class="px-6 py-4 whitespace-pre-wrap" :data-af-column="column.name">
27-
<component
28-
v-if="column?.components?.show"
29-
:is="getCustomComponent(column?.components?.show)"
30-
:resource="resource"
31-
:meta="column.components.show.meta"
32-
:column="column"
33-
:record="record"
23+
<component
24+
v-if="column.components?.showRow"
25+
:is="getCustomComponent(column.components.showRow)"
26+
:meta="column.components.showRow.meta"
27+
:column="column"
28+
:resource="coreStore.resource"
29+
:record="coreStore.record"
3430
/>
35-
<ValueRenderer
36-
v-else
37-
:column="column"
38-
:record="record"
39-
/>
40-
</td>
31+
<template v-else>
32+
<td class="px-6 py-4 relative block md:table-cell font-bold md:font-normal pb-0 md:pb-4">
33+
{{ column.label }}
34+
</td>
35+
<td class="px-6 py-4 whitespace-pre-wrap" :data-af-column="column.name">
36+
<component
37+
v-if="column?.components?.show"
38+
:is="getCustomComponent(column?.components?.show)"
39+
:resource="resource"
40+
:meta="column.components.show.meta"
41+
:column="column"
42+
:record="record"
43+
/>
44+
<ValueRenderer
45+
v-else
46+
:column="column"
47+
:record="record"
48+
/>
49+
</td>
50+
</template>
4151
</tr>
4252
</tbody>
4353
</table>
@@ -48,19 +58,24 @@
4858
import { defineProps } from 'vue';
4959
import ValueRenderer from '@/components/ValueRenderer.vue';
5060
import { getCustomComponent } from '@/utils';
51-
61+
import { useCoreStore } from '@/stores/core';
5262
defineProps<{
5363
columns: Array<{
5464
name: string;
5565
label: string;
5666
components?: {
57-
show?: {
58-
meta: Record<string, any>;
59-
};
67+
show?: {
68+
meta: Record<string, any>;
69+
};
70+
showRow?: {
71+
meta: Record<string, any>;
72+
};
6073
};
6174
}>;
6275
groupName?: string | null;
6376
resource: Record<string, any>;
6477
record: Record<string, any>;
6578
}>();
79+
80+
const coreStore = useCoreStore();
6681
</script>

0 commit comments

Comments
 (0)