Vue-select: How about optgroup?

Created on 14 Oct 2017  路  21Comments  路  Source: sagalbot/vue-select

enhancement feature request help wanted

Most helpful comment

All 21 comments

@sagalbot - We would really like to use optgroup in vue-select. Would you be willing to accept a donation to add support for optgroup to this library? We could maybe spare say $250?

Any updates on this?

+1 for optgroups!

+1 for optgroups!

+1 for optgroups

+1 for optgroups

+1 for optgroups

Hi! Here my soluction using Vue slots.

<select @change="onChange($event, index)">
  <option selected>seleccionar</option>
  <slot v-for="(item, i) in topItems">
    <optgroup :key="i" v-if="item.sections" :label="item.name">
      <option v-for="(subItem, i) in item.sections.section" :key="i" :value="subItem.url">{{ sub.name }}</option>
    </optgroup>
    <option :key="i" v-if="!item.sections" :value="item.url"> {{ item.name }} </option>
  </slot>
</select>

+1 for optgroups

+1

+1

+1

+1

+1 Would be awesome

+1

+1 please...

+1

+1 for optgroup, please

please, we all need optgroups

very much needed optgroup

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xuwenhao picture xuwenhao  路  3Comments

edalzell picture edalzell  路  3Comments

pud1m picture pud1m  路  3Comments

rudykaze picture rudykaze  路  3Comments

FrozenIce0617 picture FrozenIce0617  路  3Comments