ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.02k stars 1.28k forks source link

🧐[问题] 关于在 EditableProTable 的列可编辑 renderFormItem 中使用实体 #8247

Open restareaByWeezy opened 1 month ago

restareaByWeezy commented 1 month ago

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

在架构中,即 EditableProTable 的 columns -> renderFormItem 的第一个参数,未定义称为实体和条目的项目类型。 我应该使用 config.record 作为第三个参数吗?它的使用是否有被阻止的原因?

💻 示例代码

  renderFormItem: (schema, config, form, action) => {
              return (
                <FieldWrapper align="center">
                  <NumberInputField
                    fieldProps={{
                      style: {
                        marginBottom: 0,
                      },
                    }}
                    name={schema.dataIndex}
                    addonAfter={config?.record?.coin?.symbol} // --> schema.entity 希望使用
                  />
                </FieldWrapper>
              );
            },

🚑 其他信息