From 2156c70ff3a7e65a8ad1bf14602f0dad150382ab Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 13 May 2022 10:03:16 +0800 Subject: [PATCH] fix: link-to field data scope error (#1337) --- packages/core/client/src/block-provider/index.tsx | 1 + .../schema-component/antd/table-v2/TableSelectorDesigner.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/block-provider/index.tsx b/packages/core/client/src/block-provider/index.tsx index e9d77ea6b0..1066e3f54f 100644 --- a/packages/core/client/src/block-provider/index.tsx +++ b/packages/core/client/src/block-provider/index.tsx @@ -6,4 +6,5 @@ export * from './FormBlockProvider'; export * from './KanbanBlockProvider'; export * from './TableBlockProvider'; export * from './TableFieldProvider'; +export * from './TableSelectorProvider'; diff --git a/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx b/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx index c3b3170608..7fba25d0f9 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx @@ -2,7 +2,7 @@ import { ArrayItems } from '@formily/antd'; import { ISchema, useField, useFieldSchema } from '@formily/react'; import React from 'react'; import { useTranslation } from 'react-i18next'; -import { useTableBlockContext } from '../../../block-provider'; +import { useTableSelectorContext } from '../../../block-provider'; import { useCollection } from '../../../collection-manager'; import { useCollectionFilterOptions, useSortFields } from '../../../collection-manager/action-hooks'; import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings'; @@ -15,7 +15,7 @@ export const TableSelectorDesigner = () => { const fieldSchema = useFieldSchema(); const dataSource = useCollectionFilterOptions(name); const sortFields = useSortFields(name); - const { service } = useTableBlockContext(); + const { service } = useTableSelectorContext(); const { t } = useTranslation(); const { dn } = useDesignable(); const defaultFilter = fieldSchema?.['x-decorator-props']?.params?.filter || {};