From 858886a85288370bfc7c0991e96929811f20f561 Mon Sep 17 00:00:00 2001 From: Vladyslav <31040615+vladyslav-mikhieiev@users.noreply.github.com> Date: Wed, 9 Aug 2023 11:56:10 +0300 Subject: [PATCH] feat(Table): support nested keys in columns (#503) Co-authored-by: Benjamin Canac --- docs/content/4.data/1.table.md | 2 +- src/runtime/components/data/Table.vue | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/content/4.data/1.table.md b/docs/content/4.data/1.table.md index 357cc28efc..09fde3aed3 100644 --- a/docs/content/4.data/1.table.md +++ b/docs/content/4.data/1.table.md @@ -545,7 +545,7 @@ Even though you can customize the sort button as mentioned in the [Sortable](#so ### `-data` -Use the `#-data` slot to customize the data cell of a column. You will have access to the `row` and `column` properties in the slot scope. +Use the `#-data` slot to customize the data cell of a column. You will have access to the `row`, `column` and `getRowData` properties in the slot scope. You can for example create an extra column for actions with a [Dropdown](/elements/dropdown) component inside or change the color of the rows based on a selection. diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index dfcfca727c..9bdf9210c6 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -55,8 +55,8 @@ - - {{ row[column.key] }} + + {{ getRowData(row, column.key) }} @@ -69,9 +69,8 @@