ant-design / ant-design/pro-components
🧐[问题]在readonly模式下,为什么丢弃了ProFormList的containerClassName呢?
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🧐 在readonly模式下,ProFormList的containerClassName丢失了
我在ProFormList组件上写了属性`containerClassName="flex flex-col gap-y-4"`,用于将每个list项之间隔开4个单位的距离,在表单可编辑的模式下,是正常隔开的。在表单readonly模式下,项之间的距离丢失了,检查发现是containerClassName丢了。
提供readonly前后的两张结构截图:


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

请问:
1. 在readonly模式下,丢弃containerClassName的设计目的是什么?我想学习下。
2. 我想在readonly模式下,也将项目之间隔开4个距离,有什么其他办法吗?
Contributor guide
Research direction
Read packages/form/src/components/List/ListContainer.tsx around line 170, then compare how ProFormList renders its container in editable and readonly modes. Confirm the intended behavior from the existing structure; done means the readonly case either preserves containerClassName consistently or clearly documents the supported alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100