ant-design / ant-design/pro-components
🧐[问题] BetaSchemaForm 的 FormList 里, columns上的方法中如何获得list的下标
- 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
### 🧐 问题描述
BetaSchemaForm 的 FormList 里, columns上的方法中如何获得list的下标
### 💻 示例代码
```
const valueEnum = {
all: { text: '全部', status: 'Default' },
open: {
text: '未解决',
status: 'Error',
},
closed: {
text: '已解决',
status: 'Success',
disabled: true,
},
processing: {
text: '解决中',
status: 'Processing',
},
};
const columns = [
{
dataIndex: 'list',
valueType: 'formList',
fieldProps: {
creatorRecord: {
status: 'open',
},
},
columns: [
{
dataIndex: 'status',
valueType: 'select',
initialValue: 'open',
fieldProps: {
allowClear: false,
onSelect: onSelect,
},
title: '状态',
valueEnum: valueEnum
},
],
},
]
```
上面 onSelect 回调函数中如何获取到 list 的下标
### 🚑 其他信息
Contributor guide
Research direction
Start by tracing BetaSchemaForm's FormList implementation and the columns fieldProps onSelect callback mentioned in the example. The issue names no source file or test, so first locate the relevant form-list code and existing callback documentation; done means confirming and documenting how the list index is exposed, with a focused test if that behavior is supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100