Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
b9d80389
Commit
b9d80389
authored
Aug 06, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增Children组件 用于解决在schema中传入自定义组件
parent
ae8bf705
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
Children.tsx
src/components/NiceForm/components/Children.tsx
+13
-0
index.tsx
src/components/NiceForm/index.tsx
+3
-1
No files found.
src/components/NiceForm/components/Children.tsx
0 → 100644
View file @
b9d80389
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
src/components/NiceForm/index.tsx
View file @
b9d80389
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment