diff --git a/lib/dtable/src/plugins/nested/index.tsx b/lib/dtable/src/plugins/nested/index.tsx index 9e7f497c9c..c5fa1b59c6 100644 --- a/lib/dtable/src/plugins/nested/index.tsx +++ b/lib/dtable/src/plugins/nested/index.tsx @@ -327,14 +327,17 @@ const nestedPlugin: DTablePlugin = const {id: rowID, data: rowData} = row; const {nestedToggle, childLabel} = col.setting; const info = this.getNestedRowInfo(rowID); - if (rowData![this.options.nestedParentKey || 'parent'] && childLabel) { - let labelView: ComponentChildren; - if (typeof childLabel === 'string') { - labelView = {formatString(childLabel, rowData)}; - } else { - labelView = ; + if (childLabel) { + const parent = Number(rowData![this.options.nestedParentKey || 'parent']); + if (!Number.isNaN(parent) && parent > 0) { + let labelView: ComponentChildren; + if (typeof childLabel === 'string') { + labelView = {formatString(childLabel, rowData)}; + } else { + labelView = ; + } + result.unshift(labelView); } - result.unshift(labelView); } if (nestedToggle && (info.children || info.parent)) { result.push(