ant-design / ant-design/pro-components
🐛[BUG]BetaSchemaForm中columns为formList时,title无法拿到formlist的index
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
### 🐛 bug 描述
目前在title部分只暴露了props,type,dom 同时在formItemProps 也没有地方能拿到当前formlist的index

### 📷 复现步骤
用复现的代码可以查看
### 🏞 期望结果
目前的效果是

希望能在label前面加上index,能否有地方得到下面的效果

### 💻 复现代码
```
const columns = [
{
valueType: 'formList',
dataIndex: 'flowNodeApplyReqList',
fieldProps: {
alwaysShowItemLabel: true,
creatorButtonProps: {
creatorButtonText: '增加一行',
},
},
columns: [
{
title: '',
valueType: 'group',
rowProps: {
wrap: false,
justify: 'space-between',
},
columns: [
{
title: (props, type, dom) => {
console.log('props,type,dom', props, type, dom);
return
},
dataIndex: 'displayName',
// formItemProps: (...rest) => {
// console.log('form', rest);
// return {
// label: 'test',
// };
// },
colProps: {
span: 12,
},
},
{
title: '院区名称',
dataIndex: 'applicationCode',
params: {},
colProps: {
span: 12,
},
},
],
},
],
},
]
```
### © 版本信息
- ProComponents 版本: [e.g. 4.0.0] 2.5.0
- umi 版本 4.0.68
- 浏览器环境 chrome
- 开发环境 [e.g. mac OS] mac
### 🚑 其他信息
Contributor guide
Research direction
Start with the BetaSchemaForm entry point and the supplied columns reproduction, focusing on the formList, nested group, title callback, and formItemProps callback. Trace what arguments those callbacks receive; done means the current formList index is available where needed so the label can include it, with the reproduction showing the expected indexed label.
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
- 38/100