解决方法只需要绑定:key ="item.id"对应的id即可

报错图:
vue警告component lists rendered with v-for should have explicit keys

原代码如下:

<el-select v-model="select" slot="prepend" placeholder="请选择">					   
 <el-option :label="item.shortname" :value="item.shortname" name='全部' v-for="item in selectlist"></el-option>			  
</el-select>

修改后的代码:

 <el-select v-model="select" slot="prepend" placeholder="请选择">					   
 <el-option :label="item.shortname" :value="item.shortname" name='全部' v-for="item in selectlist" :key ="item.id"></el-option>			  
</el-select>

相关文章:

  • 2022-12-23
  • 2021-08-16
  • 2021-10-01
  • 2021-05-01
  • 2021-08-30
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2021-08-15
  • 2021-07-28
  • 2021-07-11
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案