fix: front type check
Frontend CI / build-and-check (push) Has been cancelled
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 5s
🚀 Create and publish a Docker image / Build & publish backend image (push) Has been skipped
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 16s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 3s

This commit is contained in:
2026-05-25 03:35:30 +03:00
parent 4251b33596
commit fce3044f94
2 changed files with 15 additions and 4 deletions
+12 -3
View File
@@ -1,8 +1,17 @@
<script setup lang="ts">
type Column = { key: string; label: string; align?: 'left' | 'center' | 'right' | string }
type DataTableSlotRow = Record<string, any>
defineProps<{
columns: Array<{ key: string; label: string; align?: 'left' | 'center' | 'right' | string }>
columns: Column[]
rows: Record<string, unknown>[]
}>()
defineSlots<Record<string, (props: { row: DataTableSlotRow; value: any }) => unknown>>()
function getCell(row: Record<string, unknown>, key: string) {
return row[key]
}
</script>
<template>
@@ -18,8 +27,8 @@ defineProps<{
<tbody>
<tr v-for="(row, i) in rows" :key="i">
<td v-for="col in columns" :key="col.key" :class="`align-${col.align ?? 'left'}`">
<slot :name="col.key" :row="row" :value="row[col.key]">
{{ row[col.key] }}
<slot :name="col.key" :row="row" :value="getCell(row, col.key)">
{{ getCell(row, col.key) }}
</slot>
</td>
</tr>