fix: schema Initializer demos

This commit is contained in:
chenos 2022-02-22 23:53:51 +08:00
parent 98076d628d
commit e140227798
2 changed files with 5 additions and 3 deletions

View File

@ -91,9 +91,10 @@ const AddBlockButton = observer((props: any) => {
export default function App() { export default function App() {
return ( return (
<SchemaComponentProvider designable components={{ TableBlockInitializer, Hello, AddBlockButton }}> <SchemaComponentProvider designable>
<SchemaInitializerProvider initializers={initializers}> <SchemaInitializerProvider initializers={initializers}>
<SchemaComponent <SchemaComponent
components={{ TableBlockInitializer, Hello, AddBlockButton }}
schema={{ schema={{
type: 'void', type: 'void',
name: 'page', name: 'page',

View File

@ -5,11 +5,12 @@ import {
SchemaComponent, SchemaComponent,
SchemaComponentProvider, SchemaComponentProvider,
SchemaInitializer, SchemaInitializer,
SchemaInitializerItemOptions SchemaInitializerItemOptions,
SchemaInitializerProvider,
useSchemaInitializer
} from '@nocobase/client'; } from '@nocobase/client';
import { Input } from 'antd'; import { Input } from 'antd';
import React from 'react'; import React from 'react';
import { SchemaInitializerProvider, useSchemaInitializer } from '..';
const useFormItemInitializerFields = () => { const useFormItemInitializerFields = () => {
return [ return [