Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧐[问题]在readonly模式下,为什么丢弃了ProFormList的containerClassName呢? #8979

Open
taoliujun opened this issue Jan 16, 2025 · 1 comment

Comments

@taoliujun
Copy link
Contributor

🧐 在readonly模式下,ProFormList的containerClassName丢失了

我在ProFormList组件上写了属性containerClassName="flex flex-col gap-y-4",用于将每个list项之间隔开4个单位的距离,在表单可编辑的模式下,是正常隔开的。在表单readonly模式下,项之间的距离丢失了,检查发现是containerClassName丢了。

提供readonly前后的两张结构截图:

Image

Image

看了下代码:https://github1s.com/ant-design/pro-components/blob/master/packages/form/src/components/List/ListContainer.tsx#L170

Image

请问:

  1. 在readonly模式下,丢弃containerClassName的设计目的是什么?我想学习下。
  2. 我想在readonly模式下,也将项目之间隔开4个距离,有什么其他办法吗?
@Wxh16144
Copy link
Member

丢弃containerClassName的设计目的是什么

估计纯粹是不想多套一个 div

我想在readonly模式下,也将项目之间隔开4个距离,有什么其他办法吗?

可以提一个 PR 改一下试试,等蚂蚁的人给你 review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants