Skip to content

Commit 1f40232

Browse files
committed
fix: use key on pagination table content
1 parent 71f9d00 commit 1f40232

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed

packages/components-vue/src/components/pagination/ContentTable.vue

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,33 @@
1616
@refresh="emittedRefresh = $event"
1717
@has-content="hasContent = $event"
1818
>
19-
<!-- Prevent hydration issues, data is fetched no matter what -->
20-
<BrowserOnly>
21-
<Table
22-
:nodes="mapNodes(content)"
23-
:refresh="refreshData"
24-
:class="tableClass"
25-
v-bind="{
26-
...tableProps,
27-
theme,
28-
modalProps: {
29-
invertTheme: true,
30-
class: modalClass ?? tableClass,
31-
...tableProps?.modalProps,
32-
},
33-
}"
34-
>
35-
<template v-if="$slots.headActions" #headActions>
36-
<div class="flx --flxRow --flx-start-center --gap-10 --gap:md">
37-
<slot
38-
name="headActions"
39-
v-bind="{ hasContent, refreshData }"
40-
></slot>
41-
</div>
42-
</template>
43-
<template v-if="$slots.tableChildren" #default="tableChildrenScope">
44-
<slot
45-
name="tableChildren"
46-
v-bind="{ ...tableChildrenScope, hasContent, refreshData }"
47-
></slot>
48-
</template>
49-
</Table>
50-
</BrowserOnly>
19+
<Table
20+
:key="JSON.stringify({ url, defaults, length: content?.length })"
21+
:nodes="mapNodes(content)"
22+
:refresh="refreshData"
23+
:class="tableClass"
24+
v-bind="{
25+
...tableProps,
26+
theme,
27+
modalProps: {
28+
invertTheme: true,
29+
class: modalClass ?? tableClass,
30+
...tableProps?.modalProps,
31+
},
32+
}"
33+
>
34+
<template v-if="$slots.headActions" #headActions>
35+
<div class="flx --flxRow --flx-start-center --gap-10 --gap:md">
36+
<slot name="headActions" v-bind="{ hasContent, refreshData }"></slot>
37+
</div>
38+
</template>
39+
<template v-if="$slots.tableChildren" #default="tableChildrenScope">
40+
<slot
41+
name="tableChildren"
42+
v-bind="{ ...tableChildrenScope, hasContent, refreshData }"
43+
></slot>
44+
</template>
45+
</Table>
5146
</PaginationContent>
5247
</div>
5348
</BaseErrorBoundary>
@@ -60,7 +55,6 @@
6055
import type { iTableProps } from "@open-xamu-co/ui-components-vue";
6156
6257
import BaseErrorBoundary from "../base/ErrorBoundary.vue";
63-
import BrowserOnly from "../base/BrowserOnly.vue";
6458
import Table from "../table/Simple.vue";
6559
import PaginationContent from "./Content.vue";
6660

0 commit comments

Comments
 (0)