ant-design / ant-design/pro-components
🧐[问题] Schema Form的valueType:formList,renderFormItem失效
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🧐 问题描述
我在Schema Form的使用valueType:formList,在renderFormItem想要用defaultRender,修改“新增一行”的功能,但使用formList,但renderFormItem直接无法使用了。但其他简单的valueType格式就可以使用
### 💻 示例代码
{
title: field.fieldName + "<" + field.fieldKey + ">",
dataIndex: field.fieldKey,
valueType: 'formList',
columns: [
{
valueType: 'group',
columns: childrenColumns,
},
{
dataIndex: 'batchNo',
hideInForm: true
},
],
fieldProps: (form, config) => {
return {
creatorButtonProps: showIsSource ? false : {creatorButtonText: `新建一行${field.fieldName}`},
copyIconProps: false,
}
},
renderFormItem: (schema, config, form) => {
console.log(schema)
console.log(config)
console.log(form)
return <>
{config.defaultRender()}
add()} block icon={}>
Add sights
}
};
Contributor guide
Research direction
Start with the Schema Form valueType formList path and the renderFormItem example in this issue, then reproduce the behavior with defaultRender and the custom add-row button. Done means renderFormItem works for formList as it does for simpler value types without breaking the existing formList controls.
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
- 35/100