props属性用来定义options数据源的键值对
<el-select-v2 :disabled="itemNumDisabled" v-model="form.itemNum" :scrollbar-always-on="true" filterable clearable :reserve-keyword="false"
:options="materialList" :props="props" @change="getBasMaterialData" placeholder="请输入查找物料编码"
style="width: 200px" remote :remote-method="getBasMaterialList">
<!-- <template #default="{ item }">
<span>{{ item.itemNum }}</span>
</template> -->
</el-select-v2>
在js代码块中定义props:
const props = ref({
label: "itemNum",
value: "itemNum",
});
这样标签就可以自动解析,label为显示值,value为绑定值。相比于之前的el-select标签中写el-option标签更加简单