Warning: Each child in a list should have a unique 「key「 prop.

Warning: Each child in a list should have a unique 「key」 prop. 警告:列表中的每個孩子都應該有一個唯一的「關鍵」屬性。 原因: 這是由於在進行組件遍歷的時候沒有加一個key來進行區分每個組件,因爲dom需要deff進行對比 進行循環遍歷生成組件的,將key設置爲index即可 加在循環的最外層
相關文章
相關標籤/搜索