react random key generator;react如何产生随机不重复的key?
1、<div key={+new Date() + Math.random()}>
2、使用数组的索引
3、使用uuid:https://www.npmjs.com/package/uuid
4、使用uniqid:https://www.npmjs.com/package/uniqid
5、Date.now()
- 上一篇 »Python中生成一个没有重复元素的随机序列??
- 下一篇 »PHP生成不重复随机数的方法