When using the table of ant component library today, I encountered a problem: warning.js?2149:7 Warning: [antdv: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.] 。 Record it
This is because the default key value defined in columns does not have the current field in the returned data. One is to use rowkey to specify a corresponding key value pair by default, or use a subscript index similar to that in the V-for loop
Therefore, the following fields can be introduced into the table component:
:rowKey="(record,index)=>{return index}"
After introduction, it is as follows:
<a-table :columns="columns" :data-source="data" :rowKey="(record,index)=>{return index}" />
So you won’t report an error
Read More:
- React ant design pro Error reported in the background after removing internationalization
- [Solved] Ant Design Pro Project Startup Error: ChunkError mf-va_remoteEntry umi
- DataTables warning encountered using DataTables: table id = DataTables_Table_0 – Ajax error. For more information ab
- Some problems encountered in the initial construction of Ant Design Pro project, such as cross Env, webpack and so on
- Node js events.js:183 throw er; // Unhandled ‘error’ event
- Solve the problem that the native machine cannot use ant script checkout project
- Webpack Pack and compress ES6 files with errors: ERROR in js/xxxxxx.js from UglifyJs Unexpected token punc ()
- [Solved] Groovy Project Compile Error: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream
- [Solved] Instantiation of ‘sdram_model_plus‘ failed. The design unit was not found.
- [Solved] error: package android.support.design.widget does not exist
- Vue el-table Error: Duplicated keys detected This may casuse an update error
- How to Solve Error inflating class android.support.design.widget.FloatingActionButton
- [Solved] Hbase …ERROR: Unable to read .tableinfo from file:/hbaseData/data/default/table1/xxxx
- Laravel model save if the table has no ID field Error [How to Solve]
- Doris BrokerLoad Error: No source file in this table [How to Solve]
- How to Solve Doris dynamic partition table routineload Error
- The loop of life and death occurs when the El table component of element UI is bidirectional bound
- Vue3 Warning: [Vue warn]: Extraneous non-emits event listeners (changeParentProps) were passed to component
- Element table Error: ‘tableId‘ of undefined“ [How to Solve]
- [Solved] ant-design a-date-picker Error: date.locale is not a function