控制台报错
[Vue warn]: Avoid using non-primitive value as key, use string/number value instead.
意为:避免使用非原语值作为键,而是使用字符串/数字值
解决方案:
<el-carousel-item v-for="item in imgData" :key="item">
<!--修改为-->
<el-carousel-item v-for="item in imgData" :key="imgData.value">
这里的 [Vue warn] 是指不要用对象或是数组作为key,用string或value作为key。
这里item是对象,:key相当于是索引的作用,提高循环性能-->