element el-select 手动输入进行选择

<el-form-item label="单位名称" prop="orgCode">
      <el-select v-model="filterText" filterable remote reserve-keyword placeholder="请输入" size="small" :remote-method="listQuery" :loading="loadingGr" style="width:100%" clearable @change="filterTextChange">
           <el-option v-for="item in unitList" :key="item.orgCode" :label="item.orgName" :value="item.orgCode"></el-option>
     </el-select>
</el-form-item>
loadingGr: false,
unitList: [],
filterText:'',
// 列表模糊搜索-列表
      async listQuery(queryString) {
        console.log('queryString', queryString)
        if (queryString) {
          this.loadingGr = true
          let params = {
            orgName: queryString
          }
          const res =  await DataFillingApi.queryOrgCodeByName(params);
          this.unitList = res.data
          this.loadingGr = false
        } else {
          this.unitList = []
        }
      },
      filterTextChange(val) {
        this.form.orgCode=val
        console.log('val',val)
        //this.changeForm()//查询列表
      },

你可能感兴趣的:(前端开发,elementui,javascript,前端,vue.js)