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;
          }
        })
      },
Logo

前往低代码交流专区

更多推荐