编程人生-Jinken

追求 显示经典,无废话,无闲话

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.
阅读更多
个人分类: ant-design
想对作者说点什么? 我来说一句

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

不良信息举报

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

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭