Home > OS >  It's possible to use an array of property on "text-item" in Vuetify?
It's possible to use an array of property on "text-item" in Vuetify?

Time:02-11

 <v-autocomplete
   v-model="friends"
   :disabled="isUpdating"
   :items="people"
   label="Select"
   item-text="name" <!-- use here Array ['name', 'id', 'value'] -->
   item-value="name"
  >

It's possible to use an array of property on "text-item" in Vuetify?

CodePudding user response:

As the documentation mention, yes, you can use an array too.

https://vuetifyjs.com/en/api/v-autocomplete/#props

CodePudding user response:

use slots like this:

<v-autocomplete
   v-model="friends"
   :disabled="isUpdating"
   :items="people"
   label="Select"
   item-value="name"
  >
 <template v-slot:item="{ item }">
   {{item.name}}-{{item.id}}-{{item.value}}
 </template>
</v-autocomplete>
  • Related