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>

    差不多就这样

  • 相关阅读:
    12.19手动 项目部署
    12.19 redis缓存
    12.19 redis缓存
    用压测模拟并发、并发处理(synchronized,redis分布式锁)
    12.19 异常捕获补充
    app提交版本更新的流程
    变量
    类型转换的判别
    本文档中使用的伪类型
    Callbacks
  • 原文地址:https://www.cnblogs.com/cuteCoderSnow/p/13705831.html
Copyright © 2011-2022 走看看