您当前的位置: 首页 >  ar

王佳斌

暂无认证

  • 1浏览

    0关注

    821博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Ant Design Vue - Warning: [antdv: Table] Each record in dataSource of table should have...

王佳斌 发布时间:2021-11-29 11:33:35 ,浏览量:1

前言

表格组件报错,这由于 columns 中定义的默认 key 值在返回的数据中没有当前的这个字段造成的,一个是使用 rowKey 默认指定一个对应的键值对,或者使用类似 v-for 循环中的下标 index 来代替!

Warning: [antdv: Table] Each record in dataSource of table should have a unique `key`
解决方案

table 配置 rowKey 即可,如下所示:

:rowKey="(record,index) => {return index}"

配置实例如下:



...

关注
打赏
1665568777
查看更多评论
立即登录/注册

微信扫码登录

0.0376s