vue+element-UI中el-select下拉框搜索 :filter-method自定义事件
1.添加 :filter-method=“printername” 自定义搜索事件<el-form-item label="打印机" prop="printerid"><el-select v-model="cateinfo.printerid" placeholder="请选择打印机" clearable style="width:150px;"filterable :filt
·
1.添加 :filter-method=“printername” 自定义搜索事件
<el-form-item label="打印机" prop="printerid">
<el-select v-model="cateinfo.printerid" placeholder="请选择打印机" clearable style="width:150px;" filterable :filter-method="printername">
<el-option v-for="(item,index) in printernumber" :key="index" :label="item.PRINTNAME" :value="item.ID"></el-option>
</el-select>
</el-form-item>
2.搜索事件方法 :filter-method=“printername”
printername(val){
this.$http({
url: Api.spinner.url,
method: Api.spinner.method,
data:{
storeid:this.form.storeid,
printname:val,
},
}).then(res => {
if(res.data.status === 200) {
this.printernumber = res.data.result;
}
})
},
更多推荐
已为社区贡献6条内容
所有评论(0)