diff --git a/packages/client/src/application/demos/demo2/index.tsx b/packages/client/src/application/demos/demo2/index.tsx index 674512eda..21d6d55b9 100644 --- a/packages/client/src/application/demos/demo2/index.tsx +++ b/packages/client/src/application/demos/demo2/index.tsx @@ -3,6 +3,7 @@ import { Action, AdminLayout, AntdConfigProvider, + AntdSchemaComponentProvider, APIClientProvider, AuthLayout, CollectionManagerShortcut, @@ -36,6 +37,7 @@ const providers = [ { components: { ACLShortcut, DesignableSwitch, CollectionManagerShortcut, SystemSettingsShortcut } }, ], [SchemaComponentProvider, { components: { Page, Menu, Action } }], + AntdSchemaComponentProvider, [DocumentTitleProvider, { addonAfter: 'NocoBase' }], [RouteSwitchProvider, { components: { AuthLayout, AdminLayout } }], ]; diff --git a/packages/client/src/collection-manager/CollectionManagerShortcut.tsx b/packages/client/src/collection-manager/CollectionManagerShortcut.tsx index 22f4c777c..b2d81d8b1 100644 --- a/packages/client/src/collection-manager/CollectionManagerShortcut.tsx +++ b/packages/client/src/collection-manager/CollectionManagerShortcut.tsx @@ -1,8 +1,9 @@ -import React, { useState } from 'react'; import { DatabaseOutlined } from '@ant-design/icons'; -import { SchemaComponent, useActionVisible, VisibleContext } from '../schema-component'; import { ISchema, useForm } from '@formily/react'; +import { uid } from '@formily/shared'; +import React, { useState } from 'react'; import { PluginManager } from '../plugin-manager'; +import { SchemaComponent, useActionVisible, VisibleContext } from '../schema-component'; const useCloseAction = () => { const { setVisible } = useActionVisible(); @@ -20,7 +21,7 @@ const useCloseAction = () => { const schema: ISchema = { type: 'object', properties: { - drawer1: { + [uid()]: { 'x-component': 'Action.Drawer', type: 'void', title: 'Drawer Title', diff --git a/packages/client/src/plugin-manager/PluginManager.tsx b/packages/client/src/plugin-manager/PluginManager.tsx index cf7e12744..f67c557a7 100644 --- a/packages/client/src/plugin-manager/PluginManager.tsx +++ b/packages/client/src/plugin-manager/PluginManager.tsx @@ -1,10 +1,9 @@ -import React, { createContext, useContext } from 'react'; -import { Menu, Space, Tooltip, MenuItemProps } from 'antd'; -import { SettingOutlined, MoreOutlined, DesktopOutlined } from '@ant-design/icons'; -import { get } from 'lodash'; -import { PluginManagerContext } from './context'; +import { MoreOutlined, SettingOutlined } from '@ant-design/icons'; +import { ConfigProvider, Menu, MenuItemProps, Tooltip } from 'antd'; import cls from 'classnames'; -import { ConfigProvider } from 'antd'; +import { get } from 'lodash'; +import React, { createContext, useContext } from 'react'; +import { PluginManagerContext } from './context'; export const usePrefixCls = ( tag?: string, @@ -67,7 +66,7 @@ PluginManager.Toolbar = (props: ToolbarProps) => { ); })}