ant-design / pro-components

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

🐛[BUG]EditableProTable添加name属性无法新增子列? #8316

Open Tss-16 opened 4 weeks ago

Tss-16 commented 4 weeks ago

提问前先看看:

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

🐛 bug 描述

EditableProTable需要和表格外的数据进行联动,使用name="table"属性结合完成数据联动, 但是addEditRecord()方法新增子项失效,无法新增子项且会删除已存在子项,注释掉name="table"后新增子项就可以实现。

📷 复现步骤

` // 新增子项触发方法 <Button type="text" icon={} style={{ alignSelf: 'flex-end', }} onClick={() => { actionRef.current?.addEditRecord?.( { id: (Math.random() * 1000000).toFixed(0), title: '新的一行', parentKey: record.id, }, { newRecordType: 'dataSource', parentKey: record.id, recordKey: 'id', }, ); }}

`

© 版本信息

🚑 其他信息

fnoopv commented 4 weeks ago

看不出来,给个sandbox或者贴最小化复现代码?