component lists rendered with v-for should have explicit keys.

出现 “component lists rendered with v-for should have explicit keys.”警告

修改前:

<div>
  <p class="mianFont"><img :src="imgurl" class="imgStyle">查看附件</p>
   <el-row v-for="item  in attachmentList" >
     <el-col :span="12" v-for="obj in item" >
       <el-button type="text" @click="getPicture(obj.fileType)">{
   
   {obj.name}}</el-button>
     </el-col>

   </el-row>
</div>

改正后:

<div>
  <p class="mianFont"><img :src="imgurl" class="imgStyle">查看附件</p>
   <el-row v-for="(item,index) in attachmentList" :key="index">
     <el-col :span="12" v-for="(obj,index) in item" :key="index">
       <el-button type="text" @click="getPicture(obj.fileType)">{
   
   {obj.name}}</el-button>
     </el-col>

   </el-row>
</div>

猜你喜欢

转载自blog.csdn.net/qq_39692513/article/details/90272511