tachybase_todo/docs/zh-CN/development/guide/ui-schema-designer/x-initializer.md
chenos 85d8c3ecaf
feat: update development doc (#866)
* feat: update development doc

* fix: cleanup

* fix: remove
2022-09-30 12:41:23 +08:00

977 B

x-initializer 组件

内置 x-initializer 组件

  • BlockInitializers
  • CalendarActionInitializers
  • CreateFormBlockInitializers
  • CustomFormItemInitializers
  • DetailsActionInitializers
  • FormActionInitializers
  • FormItemInitializers
  • KanbanActionInitializers
  • ReadPrettyFormActionInitializers
  • ReadPrettyFormItemInitializers
  • RecordBlockInitializers
  • RecordFormBlockInitializers
  • SubTableActionInitializers
  • TableActionColumnInitializers
  • TableActionInitializers
  • TableColumnInitializers
  • TableSelectorInitializers
  • TabPaneInitializers

替换

import React, { useContext } from 'react';
import { SchemaInitializerContext } from '@nocobase/client';

export default React.memo((props) => {
  const items = useContext(SchemaInitializerContext);
  const BlockInitializers = {};
  return (
    <SchemaInitializerContext.Provider value={{ ...items, BlockInitializers }}>
      {props.children}
    </SchemaInitializerContext.Provider>
  );
});