Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

508
Views
Vuetify <v-list-item-group> v-model mutliple selecting doesnt work
<v-list shaped>
  <v-navigation-drawer>
    <v-list shaped>
      <v-list-item-group
          v-model="selectedItem"
          multiple
      >
        <template v-for="(item, i) in items">
          <v-list-item
              :value="item"
          >
            <v-list-item-title>{{item.text}}</v-list-item-title>
          </v-list-item>
        </template>
      </v-list-item-group>
    </v-list>
  </v-navigation-drawer>
data: () => ({
    selectedItem: 0,
    drawer: null,
    items: [
      { icon: 'fas fa-home', text: 'Dashboard', route: '/home' },
      { icon: 'fas fa-money-check-alt', text: 'Invoices', route: '/invoices' },
      { icon: 'fas fa-dolly', text: 'Partners', route: '/partners' },
      { icon: 'fas fa-exchange-alt', text: 'Items', route: '/items' },
    ],
  }),

Very simple code in vuetify (2.6.1),multiple selecting doesnt work, I can't preselect first item to be selected too. Its probably related to v-list-item-group component.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There are 2 mistakes in your code:

  • when you are using multiple prop, a selectedItem should be an array;
  • when you are applying :value="item", your selectedItem array should contain the whole object instead of its index.

So your code should be:

...
<v-list-item-group
  v-model="selectedItem"
  multiple
>
  <template v-for="(item, i) in items">
    <v-list-item>
      <v-list-item-title>{{item.text}}</v-list-item-title>
    </v-list-item>
  </template>
</v-list-item-group>
...
data: () => ({
  items: [
    ...
  ],
  selectedItem: [0],
}),
...
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!