fix: resource undefind (#2589)

This commit is contained in:
katherinehhh 2023-09-04 17:55:55 +08:00 committed by GitHub
parent aff559882f
commit ec81db95fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,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 collectionField = getCollectionField(resource); const collectionField = resource && getCollectionField(resource);
const treeCollection = resource?.includes('.') ? getCollection(collectionField?.target)?.tree : !!collection?.tree; const treeCollection = resource?.includes('.') ? getCollection(collectionField?.target)?.tree : !!collection?.tree;
const dataScopeSchema = useMemo(() => { const dataScopeSchema = useMemo(() => {
return { return {