From 5d6dd81e49b49fdc0377d2854aaf25347a8de42a Mon Sep 17 00:00:00 2001 From: helloqian12138 Date: Wed, 22 May 2024 12:44:10 +0800 Subject: [PATCH] fix: value is 0 display 0 not defaultValue --- .../drip-table/src/components/cell-components/text/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/drip-table/src/components/cell-components/text/index.tsx b/packages/drip-table/src/components/cell-components/text/index.tsx index fc962573b..23f3a467c 100644 --- a/packages/drip-table/src/components/cell-components/text/index.tsx +++ b/packages/drip-table/src/components/cell-components/text/index.tsx @@ -375,7 +375,7 @@ export default class DTCText extends console.warn('[DripTable] schema.columns[].options.dataProcess is deprecated, use schema.columns[].dataTranslation instead.'); return `${prefix ?? ''}${translate(schema.options.i18n, dataProcessIndex(record, dataIndex, defaultValue, options.dataProcess)) ?? ''}${suffix ?? ''}`.split('\n'); } - return `${prefix ?? ''}${translate(schema.options.i18n, `${value || defaultValue}`)}${suffix ?? ''}`.split('\n'); + return `${prefix ?? ''}${translate(schema.options.i18n, `${value === '' || value === null || value === void 0 ? defaultValue : value}`)}${suffix ?? ''}`.split('\n'); } if (mode === 'multiple') { if (options.dataProcess) {