refs #6416 feat: VnTable

This commit is contained in:
Javier Segarra 2023-11-08 03:00:11 +01:00
parent 5c5f154c3e
commit a1414cbefd
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<script setup>
import { useI18n } from 'vue-i18n';
const $props = defineProps({
columns: { type: Object, require: true, default: null },
rows: { type: Object, require: true, default: null },
});
const { t } = useI18n();
</script>
<template>
<QTable :columns="$props.columns" :rows="$props.rows" flat hide-pagination>
<template #header="props">
<QTr :props="props" class="bg">
<QTh v-for="col in props.cols" :key="col.name" :props="props">
{{ t(col.label) }}
</QTh>
</QTr>
</template>
<template #bottom-row>
<slot name="bottom-row"></slot>
</template>
</QTable>
</template>
<style lang="scss" scoped></style>