1、一定要记得先打印 filterOption 方法的参数出来看数据结构哦,不要盲目复制文档的代码
<a-form-item label="测站编码" v-bind="validateInfos.stationId">
  <a-select
    placeholder="请选择测站编码"
    v-model:value="formData.stationId"
    show-search
    :filterOption="filterOption"
    :getPopupContainer="(triggerNode) => triggerNode.parentNode"
    @select="getDeviceNum"
    :disabled="(actionType != 'a') && (actionType != 'c')"
  >
    <a-select-option
      :value="item.id"
      v-for="item in state.siteCodeList"
      :key="item.id"
    >
      {{ item.stationName }}
    </a-select-option>
  </a-select>
</a-form-item>
const filterOption = (input, option) => {
  console.log(input, option);
  return option.children[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};

我依然而我竟然 还是觉得你最好

Logo

前往低代码交流专区

更多推荐