From 5305334d5cf513429745bab2ab7d6c35d8323961 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 13 Dec 2023 17:50:23 +0100 Subject: [PATCH] fix(table): reorder params from Object.assign to allow for non-extensible objects Non-extensible objects (such as VueJS computed properties) don't allow to be extended with Object.assign(). By inverting the two parameters, we copy all the properties of the row to the new `{ __rowKey: uuid() }` object instead. Signed-off-by: Thomas Citharel --- packages/oruga-next/src/components/table/Table.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/oruga-next/src/components/table/Table.vue b/packages/oruga-next/src/components/table/Table.vue index ada2b57db..c9f0c0b7b 100644 --- a/packages/oruga-next/src/components/table/Table.vue +++ b/packages/oruga-next/src/components/table/Table.vue @@ -587,7 +587,7 @@ const tableData = computed(() => { // if no customRowKey is given and data are objects, create unique row id for each row return props.data.map((row) => !props.customRowKey && typeof row === "object" - ? Object.assign(row, { __rowKey: uuid() }) + ? Object.assign({ __rowKey: uuid() }, row) : row, ); });