From 30065de5332db3f53839a68e1f9f8f5ece546c31 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 4 May 2023 16:17:54 +0800 Subject: [PATCH] fix: render dict --- src/components/DictTag/src/DictTag.vue | 4 ++-- src/components/Table/src/hooks/useRender.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index f74ed5b6..9309dedf 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -51,11 +51,11 @@ export default defineComponent({ return null } // 解决自定义字典标签值为零时标签不渲染的问题 - if (props.value === undefined) { + if (props.value === undefined && props.value !== null) { return null } getDictObj(props.type, props.value.toString()) - // 添加标签的文字颜色为白色,解决自定义背景颜色时标签文字看不清的问题 && isHexColor(dictData.value?.cssClass) + // 添加标签的文字颜色为白色,解决自定义背景颜色时标签文字看不清的问题 && isHexColor(dictData.value?.cssClass) return ( { if (type) { - return h(DictTag, { type: type, value: text || '', dictType: dictType || 'number' }) + return h(DictTag, { type: type, value: text !== null ? text : '', dictType: dictType || 'number' }) } return '' },