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

2020-05-15 22:37:37

解决办法:

(recordindex) => index

这样也可以

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


使用table组件的时候控制台警示:Each record in dataSource of table should have a unique key prop, or set rowKey of Table to an unique primary key,

返回的数据里没有名为key的键值,所以需要在组件上设置这个表是以什么作为key来区别每一行数据的。

解决:

使用row-key属性 (添加row-key="id")

<a-table  row-key="id"   ...  >

      ...

</a-table>



  • 2017-12-05 22:30:02

    php7.0升级php7.2

    看电脑上的教程要备份7.0配置文件以及扩展啥的,我感觉不如卸载干净重新安装

  • 2017-12-06 09:35:10

    分页优化的四种方式

    在大数据量的情况下,原本很简单的分页如果没有处理好,你会发现分页的请求会消耗你大量的数据库时间。如果你遇到了这个问题,文章给了你几个很好的解决的方案。当然,初学者若能看完这篇文章,那么它会指导你写出更具有扩展性的分页代码。