diff --git a/packages/core/client/src/block-provider/TableBlockProvider.tsx b/packages/core/client/src/block-provider/TableBlockProvider.tsx index 1f5a50e454..d1ae360457 100644 --- a/packages/core/client/src/block-provider/TableBlockProvider.tsx +++ b/packages/core/client/src/block-provider/TableBlockProvider.tsx @@ -193,9 +193,12 @@ export const TableBlockProvider = withDynamicSchemaProps((props) => { const collection = getCollection(props.collection, props.dataSource); const { treeTable } = fieldSchema?.['x-decorator-props'] || {}; const { params, parseVariableLoading } = useTableBlockParamsCompat(props); - let childrenColumnName = 'children'; + // Prevent tables with 'children' field from automatically converting to tree-structured tables + let childrenColumnName = '__nochildren__'; if (treeTable) { + childrenColumnName = 'children'; + if (resourceName?.includes('.')) { const f = getCollectionField(resourceName); if (f?.treeChildren) { @@ -209,6 +212,8 @@ export const TableBlockProvider = withDynamicSchemaProps((props) => { } params['tree'] = true; } + } else { + childrenColumnName = '__nochildren__'; } const form = useMemo(() => createForm(), [treeTable]);