Skip to content

AutoComplete is not support options slot,How to realize the a-select-opt-group? #5825

@274153705

Description

@274153705
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

2.x的时候可以实现下拉分组,到了3不支持了,只支持options prop,请问如何实现呢?

  <a-auto-complete>
    <template #options>
      <a-select-opt-group
        v-for="(item, idx) in arr"
        :key="idx"
      >
        <template #label>
          <span> {{ item.label }} </span>
        </template>
        <a-select-option
          v-for="(el, idx2) in item.children"
          :key="`${idx}_${idx2}`"
          :value="el.value"
        >
          <div>{{ el.label }}</div>
        </a-select-option>
      </a-select-opt-group>
    </template>
  </a-auto-complete>

What does the proposed API look like?

类似2.x版本功能

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions