diff --git a/packages/core/client/src/schema-component/antd/block-item/BlockItem.tsx b/packages/core/client/src/schema-component/antd/block-item/BlockItem.tsx index 2b9a4c0724..1b348571d5 100644 --- a/packages/core/client/src/schema-component/antd/block-item/BlockItem.tsx +++ b/packages/core/client/src/schema-component/antd/block-item/BlockItem.tsx @@ -9,8 +9,6 @@ import { useFieldSchema } from '@formily/react'; import cls from 'classnames'; -import { css } from '@emotion/css'; -import { theme } from 'antd'; import React, { useMemo } from 'react'; import { withDynamicSchemaProps } from '../../../hoc/withDynamicSchemaProps'; import { CustomCreateStylesUtils, createStyles } from '../../../style'; @@ -20,7 +18,6 @@ import { useGetAriaLabelOfBlockItem } from './hooks/useGetAriaLabelOfBlockItem'; import { ErrorBoundary } from 'react-error-boundary'; import { ErrorFallback } from '../error-fallback'; import { useSchemaToolbarRender } from '../../../application'; -import { useDesignable } from '../../'; const useStyles = createStyles(({ css, token }: CustomCreateStylesUtils) => { return css` @@ -87,26 +84,10 @@ export const BlockItem: React.FC = withDynamicSchemaProps( const fieldSchema = useFieldSchema(); const { render } = useSchemaToolbarRender(fieldSchema); const { getAriaLabel } = useGetAriaLabelOfBlockItem(props.name); - const { token } = theme.useToken(); - const { designable } = useDesignable(); const label = useMemo(() => getAriaLabel(), [getAriaLabel]); return ( - + {render()} console.log(err)}> {children} diff --git a/packages/core/client/src/schema-component/antd/grid/Grid.tsx b/packages/core/client/src/schema-component/antd/grid/Grid.tsx index 2926cf97b8..45df2e5b5d 100644 --- a/packages/core/client/src/schema-component/antd/grid/Grid.tsx +++ b/packages/core/client/src/schema-component/antd/grid/Grid.tsx @@ -13,6 +13,8 @@ import { ISchema, RecursionField, Schema, observer, useField, useFieldSchema } f import { uid } from '@formily/shared'; import cls from 'classnames'; import _ from 'lodash'; +import { css } from '@emotion/css'; +import { theme } from 'antd'; import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; import { SchemaComponent, useDesignable, useSchemaInitializerRender } from '../../../'; import { useFormBlockContext, useFormBlockType } from '../../../block-provider/FormBlockProvider'; @@ -333,7 +335,8 @@ export const Grid: any = observer( const rows = useRowProperties(); const { setPrintContent } = useFormBlockContext(); const { styles } = useStyles(); - + const { token } = theme.useToken(); + const { designable } = useDesignable(); const distributedValue = distributed === undefined ? fieldSchema?.parent['x-component'] === 'Page' || fieldSchema?.parent['x-component'] === 'Tabs.TabPane' @@ -356,7 +359,18 @@ export const Grid: any = observer( return ( -
+
{showDivider ? (