0
0
Fork 0

fix(VnTable): visible if is nullish

This commit is contained in:
Alex Moreno 2024-07-09 14:56:27 +02:00
parent c10f62b717
commit 36fc988df2
1 changed files with 9 additions and 5 deletions

View File

@ -152,7 +152,7 @@ function splitColumns(columns) {
columns: [],
chips: [],
create: [],
visible: [],
cardVisible: [],
};
for (const col of columns) {
@ -160,7 +160,7 @@ function splitColumns(columns) {
if (col.chip) splittedColumns.value.chips.push(col);
if (col.isTitle) splittedColumns.value.title = col;
if (col.create) splittedColumns.value.create.push(col);
if (col.cardVisible) splittedColumns.value.visible.push(col);
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
if ($props.isEditable && col.disable == null) col.disable = false;
if ($props.useModel) col.columnFilter = { ...col.columnFilter, inWhere: true };
splittedColumns.value.columns.push(col);
@ -311,7 +311,11 @@ defineExpose({
/>
</template>
<template #header-cell="{ col }">
<QTh v-if="col.visible" auto-width style="min-width: 100px">
<QTh
v-if="col.visible ?? true"
auto-width
style="min-width: 100px"
>
<div
class="q-pt-sm q-px-sm ellipsis"
:class="`text-${col?.align ?? 'left'}`"
@ -354,7 +358,7 @@ defineExpose({
auto-width
class="no-margin q-px-xs"
:class="getColAlign(col)"
v-if="col.visible"
v-if="col.visible ?? true"
>
<slot :name="`column-${col.name}`" :col="col" :row="row">
<VnTableColumn
@ -443,7 +447,7 @@ defineExpose({
:class="$props.cardClass"
>
<div
v-for="col of splittedColumns.visible"
v-for="col of splittedColumns.cardVisible"
:key="col.name"
class="fields"
>