Skip to content

🧐[问题]ProForm中设置grid 后, 在ProFormList里的组件设置colProps会不生效 #9083

@zwd609258057

Description

@zwd609258057

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

💻 示例代码

<ProForm
name="generalRule"
layout="horizontal"
submitter={false}
grid
rowProps={{ gutter: [16, 8] }}
>
<ProFormList
name={name}
copyIconProps={false}
colProps={{ span: 24 }}>
<ProFormSelect
colProps={{ span: 12 }}
/>
<ProFormSelect
colProps={{ span: 12}}
/>


其中ProFormList中ProFormSelect的colProps会无效,原因是ant-pro-form-list-container并不是一个有效的ant-row,需要把ant-pro-form-list-container设为flex布局
目前有两个解决方案:
<ProFormList itemContainerRender={(dom) => [<Row key="row" gutter={[8, 8]} style={{ marginBottom: 8 }}>{dom}]} />
或者

请问还有更好的方案吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions