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
776c67ad
Commit
776c67ad
authored
Jul 27, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加分列容器
parent
21563b87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
index.tsx
src/components/NiceForm/public/index.tsx
+31
-0
No files found.
src/components/NiceForm/public/index.tsx
View file @
776c67ad
...
...
@@ -139,3 +139,34 @@ registerVirtualBox('MellowCardBox', (_props) => {
</
MellowCard
>
)
})
// 分列 容器
registerVirtualBox
(
'ColumnLayout'
,
(
_props
)
=>
{
const
{
children
,
props
}
=
_props
;
const
xComponentProps
=
props
[
'x-component-props'
]
||
{};
const
{
column
=
3
,
}
=
xComponentProps
;
const
span
=
24
/
column
;
const
childNodes
:
React
.
ReactElement
[]
=
React
.
Children
.
map
(
children
,
(
child
)
=>
child
);
const
cols
=
Array
.
apply
(
null
,
Array
(
column
)).
map
(()
=>
[]);
childNodes
.
forEach
((
item
,
index
)
=>
{
cols
[
index
%
column
].
push
(
item
);
});
return
(
<
Row
gutter=
{
32
}
>
{
cols
.
map
((
item
,
index
)
=>
(
<
Col
key=
{
index
}
span=
{
span
}
>
{
item
}
</
Col
>
))
}
</
Row
>
)
})
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