React Bootstrap Table KeyField 有两个主键

React Bootstrap Table KeyField with two Primary Key

我有一个 table,其中有两列都是主键。如何定义具有两个主键的 KeyField?

prikeyarr 包含 [book_id、author_id].

<BootstrapTable keyField={props.prikeyarr} data={props.records} columns={columns} striped />

上面的代码给我错误警告...

因此,在这种情况下,我只能将一个主键作为keyField。

keyField(必填)- [字符串]

BootstrapTable

我会把它组合成字符串,例如

primaryKeyString=`${book_id}_${author_id}`