From f4bff0c836f0a19d9ef7508fb411665a313ee3ed Mon Sep 17 00:00:00 2001 From: xingyuv Date: Fri, 14 Apr 2023 15:49:14 +0800 Subject: [PATCH] fix: dict --- src/components/Table/src/hooks/useRender.ts | 3 --- src/utils/dict.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/Table/src/hooks/useRender.ts b/src/components/Table/src/hooks/useRender.ts index 4fdb080a..85d04903 100644 --- a/src/components/Table/src/hooks/useRender.ts +++ b/src/components/Table/src/hooks/useRender.ts @@ -50,9 +50,6 @@ export const useRender = { } }, renderDict: (text, type, dictType?) => { - if (!text) { - return '' - } if (type) { return h(DictTag, { type: type, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index f6f40c00..5d26ffde 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -68,7 +68,7 @@ export const getBoolDictOptions = (dictType: string) => { export const getDictObj = (dictType: string, value: any) => { const dictOptions: DictDataType[] = getDictOptions(dictType) - if (dictOptions && dictOptions.length > 0) { + if (dictOptions) { dictOptions.forEach((dict: DictDataType) => { if (dict.value === value.toString()) { return dict