feat(VnTable): add slots for columns
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2024-07-02 14:55:32 +02:00
parent 73ec367987
commit 22f42ca7f9
1 changed files with 23 additions and 15 deletions

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,13 +310,15 @@ defineExpose({
class="no-margin q-px-xs"
:class="getColAlign(col)"
>
<VnTableColumn
:column="col"
:row="row"
:is-editable="false"
v-model="row[col.name]"
component-prop="columnField"
/>
<slot :name="`column-${col.name}`" :col="col" :row="row">
<VnTableColumn
:column="col"
:row="row"
:is-editable="false"
v-model="row[col.name]"
component-prop="columnField"
/>
</slot>
</QTd>
</template>
<template #body-cell-tableActions="{ col, row }">
@ -412,14 +414,20 @@ defineExpose({
stopEventPropagation($event)
"
>
<VnTableColumn
:column="col"
<slot
:name="`column-${col.name}`"
:col="col"
:row="row"
:is-editable="false"
v-model="row[col.name]"
component-prop="columnField"
:show-label="true"
/>
>
<VnTableColumn
:column="col"
:row="row"
:is-editable="false"
v-model="row[col.name]"
component-prop="columnField"
:show-label="true"
/>
</slot>
</span>
</template>
</VnLv>