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

个人笔记


使用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.
阅读更多
版权声明:原创文章,转载请注明出处,来自https://blog.csdn.net/Jacabe https://blog.csdn.net/Jacabe/article/details/70242695
个人分类: ant-design
上一篇eclipse启动tomcat 卡住preparing launch delegate
下一篇ant-design`Form[inline|horizontal|vertical]` is deprecated, please use `Form[layout]`
想对作者说点什么? 我来说一句

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

关闭
关闭
关闭