【发布时间】:2021-08-07 16:19:58
【问题描述】:
我在 react JS 中有一个动态生成的表格,格式如下:
<table>
<tr className="Green"> // This class will be assigned at sometime say 10 AM
<td>Row 1</td>
<td>Row 2</td>
</tr>
<tr className="Green"> // this class will be assigned at another time say 10:01 AM
<td>Row 1</td>
<td>Row 2</td>
</tr>
<tr className="Green"> // this class will be assigned at other time say 10:02 AM
<td>Row 1</td>
<td>Row 2</td>
</tr>
</table>
现在我的问题是我想在分配后 60 秒后删除“绿色”类。表示第一堂课将在上午 10:01 移除,而其他课程将分别在上午 10:02 和 10:03 移除。
“绿色”类是不可预测的。它将被随机分配给
同时可以有多个“绿色”类
我怎样才能做到这一点?不会有固定的编号,因为它们都是动态生成的。请原谅我的英语不好。
【问题讨论】:
-
我已经在 React 中使用正确的方式提交了一个有效的答案,请看一下,谢谢
标签: javascript reactjs next.js