在ProForm下不设置grid = true的情况下 使用ProFormList怎么和 ProForm下的其他表单项对齐? #9233
Unanswered
kelisiWu123
asked this question in
Q&A
Replies: 1 comment
-
ProFormList 在不设置 grid=true 的情况下,确实无法像普通 ProForm 表单项那样自动对齐。社区和维护者建议的常用做法有:
示例代码(用 Row 包裹每一行): <ProFormList
name="list"
label="列表"
itemContainerRender={dom => (
<Row gutter={8} style={{ marginBottom: 8 }}>
{dom}
</Row>
)}
containerStyle={{ marginBottom: 24 }}
>
<ProFormText name="field" label="字段" />
</ProFormList> 或者直接设置 containerClassName: <ProFormList
name="list"
label="列表"
containerClassName="ant-row"
>
<ProFormText name="field" label="字段" />
</ProFormList> 注意:这些方法只是视觉上对齐,底层没有官方一键式方案,属于社区常用 workaround。更多讨论和代码示例可以参考 相关 issue1 和 issue2。 To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
在ProForm下不设置grid = true的情况下 使用ProFormList怎么和 ProForm下的其他表单项对齐?
Beta Was this translation helpful? Give feedback.
All reactions