zoukankan      html  css  js  c++  java
  • antD中关于table组件中报这样的警告warning.js?2149:7 Warning: [antdv: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.] 解决办法

    关于antD中warning.js?2149:7 Warning: [antdv: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.]

    含义:[antdv:表中的每条记录都应该有唯一的' key ' prop,或者将' rowKey '设置为唯一的主键。]

    一般这种情况的消除就直接用表格的每一行的单独的主键id就行了(后台返回值一般这种列表都会返回主键唯一id,不行的话就用index数组下标也不会重复

    <a-table bordered :data-source="dataSource" :columns="columns" :pagination="pagination" :rowKey="record=>record.id">
                <template slot="handle" slot-scope="text,recode">
                    <a @click="showInformation(recode)">详情</a>
                    <a-divider type="vertical" />
                    <a @click="operation(recode)">编辑</a>
                </template>
            </a-table>

    差不多就这样

  • 相关阅读:
    Android的各版本间的区别总结
    深入浅出Android开发之Surface介绍
    android中完全退出当前应用程序的四种方法
    android离线地图源码
    坐标系
    mysql安装
    linux磁盘空间清理
    HttpClient教程
    TIME_WAIT过多
    c3p0配置详解
  • 原文地址:https://www.cnblogs.com/cuteCoderSnow/p/13705831.html
Copyright © 2011-2022 走看看