使用el-select组件时,如果不加特别配置,选项里的对象都是蓝色,为选中状态。 这时,需要在<el-select>里添加 value=key="id"项 ,然后在option里面的key = id,这样就可以正常传递对象值了 如下图:
<el
-select v
-model
="selected_item" value
-key
="id" style
="width: 150px;" clearable filterable
:loading
="loading" >
<el
-option v
-for="item in members.dataList" :key
="item.id" :label
="`${item.user_name}(${item.user_phone})`" :value
="item" />
</el
-select
>
转载请注明原文地址:https://blackberry.8miu.com/read-909.html