ant-design Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an un

版权声明:原创文章,转载请注明出处,来自https://blog.csdn.net/Jacabe https://blog.csdn.net/Jacabe/article/details/70242695

个人笔记


使用ant-design 组件 出现此警告的时候

Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.

是因为 返回的数据需要 加上key 

如下


const data=[{ key:'1', name:'John Brown', age:32, address:'New York No. 1 Lake Park',},

{ key:'2', name:'Jim Green', age:42, address:'London No. 1 Lake Park',},

{ key:'3', name:'Joe Black', age:32, address:'Sidney No. 1 Lake Park',}];

browser.js:49Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.
阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页