< el-select size= "mini" clearable filterable: filter-method= "warehouseFilter" vmurmodel.trim = "formInline.planWarehouseId": placeholder= "nowLangue.pleaseSelect" >
< el-option VFOR = "(list,index) in warehouseLists": key= "index": label= "list.name": value= "list.id" > < / el-option >
< / el-select >
warehouseFilter (val) {
if (val) { //val
this.warehouseLists = this.warehouseListsCopy.filter((item) => {
if (!!~item.name.indexOf(val) || !!~item.code.toUpperCase().indexOf(val.toUpperCase())) {
return true
}
})
} else { //val
this.warehouseLists = this.warehouseListsCopy;
}
},
has anyone ever used the filter-method method? when I type code or name in the input box, if the matching data is not the first one, the input Filter content will be emptied. What is the reason for this? Please give me some advice, thank you