If the elementUI filter-method matches not the first piece of data, then the Filter content will be emptied. How to solve this problem?

< 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

Mar.11,2021

same question. Just assign val back to v-model

....

this.formInline.planWarehouseId = val

....

I have the same problem. Could you tell me how to solve it?

Menu