This commit is contained in:
2026-02-05 14:44:54 +07:00
parent c3a8e5b474
commit 7f5bfc7a71
55 changed files with 1559 additions and 2591 deletions

View File

@@ -0,0 +1,35 @@
<script setup lang="ts" generic="T">
interface TableProps<T> {
value: T[];
dataKey: string;
selection?: T[];
tableStyle?: string;
}
const props = defineProps<TableProps<T>>();
const emit = defineEmits<{
'update:selection': [value: T[]];
}>();
</script>
<template>
<div class="overflow-x-auto">
<table :class="['w-full', tableStyle]">
<thead>
<tr class="border-b border-gray-200 bg-gray-50">
<slot name="header" />
</tr>
</thead>
<tbody>
<tr
v-for="(item, index) in value"
:key="String((item as any)[dataKey])"
class="border-b border-gray-100 hover:bg-gray-50 transition-colors"
>
<slot name="body" :data="item" :index="index" />
</tr>
</tbody>
</table>
</div>
</template>