Commit b9d80389 authored by 前端-许佳敏's avatar 前端-许佳敏

新增Children组件 用于解决在schema中传入自定义组件

parent ae8bf705
import React from 'react'
const Children = ({props}) => {
const children = props["x-component-props"] ? props["x-component-props"].children : null
return children
}
Children.defaultProps = {}
Children.isFieldComponent = true;
export default Children
\ No newline at end of file
import React from 'react';
import SchemaForm, {
IAntdSchemaFormProps,
IAntdSchemaFormProps, createVirtualBox, registerVirtualBox,
} from '@formily/antd';
import { Button, Space } from 'antd';
import CustomUpload from './components/CustomUpload';
......@@ -14,6 +14,7 @@ import CardCheckBox from './components/CardCheckBox';
import MultTable from './components/MultTable';
import CustomRegistryPhone from './components/CustomRegistryPhone';
import CustomRelevance from './components/CustomRelevance';
import Children from './components/Children';
export interface NiceFormProps extends IAntdSchemaFormProps {}
......@@ -31,6 +32,7 @@ const NiceForm: React.FC<NiceFormProps> = props => {
MultTable,
CustomRegistryPhone,
CustomRelevance,
Children
};
const defineComponents = Object.assign(customComponents, components);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment