0
点赞
收藏
分享

微信扫一扫

<a-select/>对已获取的数据进行模糊查询

奔跑的酆 2022-02-08 阅读 44

HTML:

<a-col :span="5">
        <label class="label-title">环节:</label>
        <a-select style="width: 80%;"
         placeholder="请选择环节" 
         class="select-option" 
         :allowClear="allowClear"
          :showSearch="showSearch" 
          option-filter-prop="children"
          :filter-option="filterOption"
          :maxTagCount="1" @change="handleChangeDetail" v-model="detailCode"
          >
          <a-select-option v-for="item in linkDetails" :key="item.linkDetailCode" :value="item.linkDetailCode">
            {{ item.linkDetailName }}
          </a-select-option>
        </a-select>
      </a-col>

JS:

/**
   * 实现环节搜索:拼接及汉字模糊搜索
   */
  filterOption(input, option) {
    return (
      option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    );
  }
举报

相关推荐

0 条评论