fix(BaTable):修复单元格 tag 渲染器值为 0 时不渲染的问题

This commit is contained in:
妙码生花 2024-10-27 10:44:40 +08:00
parent 16a1a5b84e
commit 7abe284445
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-tag v-if="cellValue != ''" :type="getTagType(cellValue, field.custom)" :effect="field.effect ?? 'light'" :size="field.size ?? 'default'"> <el-tag v-if="cellValue !== ''" :type="getTagType(cellValue, field.custom)" :effect="field.effect ?? 'light'" :size="field.size ?? 'default'">
{{ !isEmpty(field.replaceValue) ? field.replaceValue[cellValue] ?? cellValue : cellValue }} {{ !isEmpty(field.replaceValue) ? field.replaceValue[cellValue] ?? cellValue : cellValue }}
</el-tag> </el-tag>
</div> </div>

View File

@ -3,7 +3,7 @@
<template v-if="isArray(cellValue)"> <template v-if="isArray(cellValue)">
<template v-for="(tag, idx) in cellValue" :key="idx"> <template v-for="(tag, idx) in cellValue" :key="idx">
<el-tag <el-tag
v-if="tag != ''" v-if="tag !== ''"
class="m-4" class="m-4"
:type="getTagType(tag, field.custom)" :type="getTagType(tag, field.custom)"
:effect="field.effect ?? 'light'" :effect="field.effect ?? 'light'"
@ -15,7 +15,7 @@
</template> </template>
<template v-else> <template v-else>
<el-tag <el-tag
v-if="cellValue != ''" v-if="cellValue !== ''"
:type="getTagType(cellValue, field.custom)" :type="getTagType(cellValue, field.custom)"
:effect="field.effect ?? 'light'" :effect="field.effect ?? 'light'"
:size="field.size ?? 'default'" :size="field.size ?? 'default'"