feat(VnTable): add slots for columns #512

Merged
jsegarra merged 2 commits from 6825-vnTable-column-slots into dev 2024-07-02 13:03:27 +00:00
1 changed files with 23 additions and 15 deletions
Showing only changes of commit 22f42ca7f9 - Show all commits

View File

@ -175,7 +175,7 @@ function columnName(col) {
}
function getColAlign(col) {
return 'text-' + (col.align ?? 'left')
return 'text-' + (col.align ?? 'left');
}
defineExpose({
reload,
@ -310,6 +310,7 @@ defineExpose({
class="no-margin q-px-xs"
:class="getColAlign(col)"
>
<slot :name="`column-${col.name}`" :col="col" :row="row">
<VnTableColumn
:column="col"
:row="row"
@ -317,6 +318,7 @@ defineExpose({
v-model="row[col.name]"
component-prop="columnField"
/>
</slot>
</QTd>
</template>
<template #body-cell-tableActions="{ col, row }">
@ -411,6 +413,11 @@ defineExpose({
@click="
stopEventPropagation($event)
"
>
<slot
:name="`column-${col.name}`"
:col="col"
:row="row"
>
<VnTableColumn
:column="col"
@ -420,6 +427,7 @@ defineExpose({
component-prop="columnField"
:show-label="true"
/>
</slot>
</span>
</template>
</VnLv>