fix(client): cannot read properties of undefined

This commit is contained in:
chenos 2023-03-17 12:27:35 +08:00
parent 471b319b86
commit fb0cdb704f
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ export const TableBlockProvider = (props) => {
params['sort'] = ['sort']; params['sort'] = ['sort'];
} }
let childrenColumnName = 'children'; let childrenColumnName = 'children';
if (collection.tree && treeTable !== false) { if (collection?.tree && treeTable !== false) {
if (resourceName.includes('.')) { if (resourceName.includes('.')) {
const f = getCollectionField(resourceName); const f = getCollectionField(resourceName);
if (f?.treeChildren) { if (f?.treeChildren) {

View File

@ -39,7 +39,7 @@ export const TableBlockDesigner = () => {
const template = useSchemaTemplate(); const template = useSchemaTemplate();
const collection = useCollection(); const collection = useCollection();
const { dragSort, resource } = field.decoratorProps; const { dragSort, resource } = field.decoratorProps;
const treeChildren = resource.includes('.') ? getCollectionField(resource)?.treeChildren : !!collection?.tree; const treeChildren = resource?.includes('.') ? getCollectionField(resource)?.treeChildren : !!collection?.tree;
const fixedBlockDesignerSetting = useFixedBlockDesignerSetting(); const fixedBlockDesignerSetting = useFixedBlockDesignerSetting();
return ( return (
<GeneralSchemaDesigner template={template} title={title || name}> <GeneralSchemaDesigner template={template} title={title || name}>