1、可搜索、可清空的选择器:
<el-select
filterable
clearable
size="mini"
class="tool-item"
v-model="updateData.deviceTypeUuid"
placeholder="请选择设备类型"
>
<el-option
v-for="item in deviceTypeList"
:key="item.uuid"
:label="item.typeName"
:value="item.uuid"
>
</el-option>
</el-select>
2、可搜索、可清空、可输入的选择器:
<el-select
@blur="brandSelectEdit"
filterable
clearable
size="mini"
class="tool-item"
v-model="updateData.brand"
placeholder="请选择品牌"
>
<el-option
v-for="item in brandList"
:key="item.brand"
:label="item.brand"
:value="item.brand"
>
</el-option>
</el-select>
brandSelectEdit(e) {
this.updateData.brand = e.target.value;
},
注:使用焦点消失事件来完成输入功能。