¿为什么no-match-text在el-select元素UI中对我不正确?

问题描述

我正在使用el-select,可以从本文档中进行自我指导 https://element.eleme.io/#/en-US/component/select#remote-search 我遇到的问题是,当我搜索端点时由于找不到端点而找不到端点时,我收到错误消息,但是在-select中,它保持加载状态,然后select开始出现诸如无法执行等问题。删除正在搜索内容

enter image description here

它仅停留在“正在加载请稍候”

<el-select :disabled="isdisabled"
  ref="zipCodeselect"
  v-model="form[zipName]"
  filterable
  remote
  reserve-keyword
  clearable
  placeholder="Type Zip Code"
  loading-text="Loading,please wait"
  no-match-text="Zip code not found"    
  :remote-method="remoteSearch"
  @change="handleSelect"
  @blur="handle_blur"
  @focus="handle_focus"
  :loading="loading">
  <el-option
     v-for="item in zipcodes"
     :key="item.id"
     :label="item.zip_code"
     :value="item.zip_code">
  </el-option>
</el-select>

async remoteSearch(query){
               this.zipCodeValue = query;
               if (query !== '' && query.length >= 3) {
                  try{
                     this.loading = true;
                     let result = await axios.get(config.routePrefix + this.zipCodeRoute + '/search?filter=' + query );
                     if(result.status == 200 && result.data.length > 0){
                        this.zipcodes = result.data;  
                        this.loading = false;
                     }
                  }
                  catch(e){
                     console.log("ERROR");
                     console.log(e);
                     console.log(this.$refs.zipCodeselect);
                     /* this.$refs.zipCodeselect.selected.currentLabel = "";
                     this.$refs.zipCodeselect.selected.value = "";
                     this.$refs.zipCodeselect.value = ""; */
                  }
               }
               else{
                  this.zipcodes = [];
               }
            },

我需要的是,如果记录不存在,那么它不会出现“正在加载,请稍候”;如果不存在,则“邮政编码不存在”,并在选择之外单击以删除删除正在搜索内容

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)