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
5369269d
Commit
5369269d
authored
May 25, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 card布局容器
parent
11eb0e04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
index.tsx
src/components/NiceForm/public/index.tsx
+32
-0
No files found.
src/components/NiceForm/public/index.tsx
View file @
5369269d
...
...
@@ -4,6 +4,7 @@ import { registerVirtualBox, SchemaField } from "@formily/antd"
import
{
Col
,
Row
,
Space
}
from
'antd'
import
cx
from
'classnames'
import
styled
from
'styled-components'
import
themeConfig
from
'../../../../config/lingxi.theme.config'
;
const
RowLayout
=
styled
(
props
=>
<
Row
justify=
'end'
{
...
props
}
/>)
`
.mega-layout-item {
...
...
@@ -14,6 +15,17 @@ const RowLayout = styled(props => <Row justify='end' {...props}/>)`
}
`
const
CardBox
=
styled
(
props
=>
<
div
{
...
props
}
/>)
`
.card-box-title {
padding-left:
${
themeConfig
[
'@padding-xs'
]}
;
margin-bottom:
${
themeConfig
[
'@margin-lg'
]}
;
line-height:
${
themeConfig
[
'@font-size-lg'
]}
;
font-size:
${
themeConfig
[
'@font-size-lg'
]}
;
font-weight: 500;
border-left: 2px solid
${
themeConfig
[
'@primary-color'
]}
;
}
`
const
renderCol
=
(
schema
,
isLast
)
=>
{
const
{
flexcol
=
{}
}
=
schema
[
'x-component-props'
]
return
<
Col
style=
{
isLast
?
{}
:
{
marginRight
:
24
}
}
{
...
flexcol
}
key=
{
schema
.
path
}
>
...
...
@@ -92,4 +104,23 @@ registerVirtualBox('LeftRightLayout', (_props) => {
))
}
</
Row
>
)
})
// card容器
registerVirtualBox
(
'CardBox'
,
(
_props
)
=>
{
const
{
children
,
props
}
=
_props
;
const
title
=
props
[
'x-component-props'
]
?
props
[
'x-component-props'
].
title
:
''
;
const
wrapProps
=
props
[
'x-component-props'
]
?
props
[
'x-component-props'
].
wrapProps
:
{};
return
(
<
CardBox
{
...
wrapProps
}
>
<
div
className=
"card-box-title"
>
{
title
}
</
div
>
<
div
>
{
children
}
</
div
>
</
CardBox
>
)
})
\ No newline at end of file
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