Skip to content

Commit a5a24ad

Browse files
committed
feat: rowClick emit to the afcl table
1 parent 2787f3a commit a5a24ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

adminforth/spa/src/afcl/Table.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
'afcl-table-body odd:bg-lightTableOddBackground odd:dark:bg-darkTableOddBackground even:bg-lightTableEvenBackground even:dark:bg-darkTableEvenBackground': evenHighlights,
5858
'border-b border-lightTableBorder dark:border-darkTableBorder': index !== dataPage.length - 1 || totalPages > 1,
5959
}"
60+
@click="tableRowClick(item)"
6061
>
6162
<td class="px-6 py-4" :key="`cell-${index}-${column.fieldName}`"
6263
v-for="column in props.columns"
@@ -242,6 +243,7 @@
242243
'update:sortField',
243244
'update:sortDirection',
244245
'sort-change',
246+
'clickTableRow'
245247
]);
246248
247249
function onPageInput(event: any) {
@@ -349,4 +351,8 @@ function sortArrayData(data:any[], sortField?:string, dir:'asc'|'desc'='asc') {
349351
return dir === 'asc' ? cmp : -cmp;
350352
});
351353
}
354+
355+
function tableRowClick(row) {
356+
emit("clickTableRow", row)
357+
}
352358
</script>

0 commit comments

Comments
 (0)