react中map循环中key取值问题

数组中没有唯一的key,可以定义变量,拼接字符串连接。

let  i = 0;
key={`infoItem-col-${i++}`}

  

posted on 2019-03-11 18:07  Diamond_xx  阅读(869)  评论(0编辑  收藏  举报

导航