首页 > 其他 > 详细

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

时间:2021-07-08 18:13:52      阅读:19      评论:0      收藏:0      [点我收藏+]

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

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

错误原因:表格中的表一条数据都应该有一个key或者rowkey

解决方法:

在设置table格式的位置加入:rowKey="(record,index)=>{return index}",如下所示:
<a-table
:columns="tableCols"
:data-source="tableData"
:rowKey="(record,index)=>{return index}"
>
<a slot="a2" slot-scope="text">{{ text }}</a>
</a-table>

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

原文:https://www.cnblogs.com/SolitaryOrchid/p/14986981.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!