el-select 的value-key="brandId" 为item的主键,
el-option 的value="item".
<el-select v-model="form_item.brand.brandId"
filterable
:filter-method="brandFilter"
value-key="brandId"
@change="initSubgroupByBrand"
no-data-text="Not find any data"
placeholder="Select Brand"
clearable>
<el-option v-for="item in filterBrandArr"
:key="item.brandName"
:label="item.brandName"
:value="item" >
<span style="float: left;margin-right: 20px;">
{{ item.brandName }}
</span>
</span>
</el-option>
获取选择的item
const initSubgroupByBrand = async (item: ProdBrandItem) => {
if (!item || !item.brandId) return
form_item.value.brand.brandName = item.brandName
}