1. 程式人生 > >vue v-for 遍歷循環時的key值的報錯

vue v-for 遍歷循環時的key值的報錯

bsp ive using IT void 對象 key值 索引 AR

問題如下:

[Vue warn] Avoid using non-primitive value as key, use string/number value instead.

non-primitive表示的是對象

這裏的[Vue warn]是指不要用對象或是數組作為key,用string或number作為key。


:key相當於是索引的作用,提高循環性能,如果循環量較小,不寫也可以的。

vue v-for 遍歷循環時的key值的報錯