EditableProTable 新增一行时,报错“EditableProTable 新增一行时,报错 Uncaught (in promise) Error: 请设置 recordCreatorProps.record 并返回一个唯一的key”

1、EditableProTable  新增一行时,报错

Uncaught (in promise) Error: 请设置 recordCreatorProps.record 并返回一个唯一的key
    at Object.eval [as current] (index.js:679:1)
    at Object.eval [as addEditRecord] (index.js:11:1)
    at _callee$ (index.js:50:1)
    at tryCatch (regeneratorRuntime.js:45:1)
    at Generator.eval (regeneratorRuntime.js:133:1)
    at Generator.eval [as next] (regeneratorRuntime.js:74:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:22:1)

  解决办法:加上recordCreatorProps参数,建立唯一ID

recordCreatorProps={{
            record: (index) => {
              return { id: index + 1 };
            },
        }}

  

 

posted @ 2024-05-28 11:49  信铁寒胜  阅读(150)  评论(0编辑  收藏  举报