Vue-multiselect: Is it possible to show nested items ?

Created on 9 Aug 2017  路  3Comments  路  Source: shentao/vue-multiselect

Is it possible to show nested items as is in multiselect?

my array structure looks like this

[
  {
    text: 'level1-a',
    children: [
      {
        text: 'level2-a',
        id: 1
      },
      {
        text: 'level2-b',
        id: 2
      },
      {
        text: 'level2-c',
        children: [
          {
            text: 'level3-a',
            id: 3
          }
        ]
      }
    ]
  },
  {
    text: 'level1-b',
    id: 4
  }
]
3.0

Most helpful comment

This is only possible for the 1st layer of nesting if you use groups. Although the group name can鈥檛 be picked as it鈥檚 just a wrapper.

This could be possible in the 3.0 release though.

All 3 comments

previously, this was achieved with select2 formatSelection/formatResult, how would achieve this with vue-multiselect?

From what i have understood, i need to create a custom template that represents my option, and then handle the rendering as a part of the option scoped slot?

This is only possible for the 1st layer of nesting if you use groups. Although the group name can鈥檛 be picked as it鈥檚 just a wrapper.

This could be possible in the 3.0 release though.

With the upcoming release the group names will allow for picking the whole group if groupSelect is enabled.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PrimozRome picture PrimozRome  路  3Comments

MaxHalford picture MaxHalford  路  4Comments

Uninen picture Uninen  路  4Comments

andreasvirkus picture andreasvirkus  路  3Comments

zachleigh picture zachleigh  路  3Comments