[Vuejs]-How do I get input from a v-menu?

0๐Ÿ‘

โœ…

If you use v-list-item-group tag as parent of v-list-item you can use v-model on v-list-item-group and this will give the index of selected item.

<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
 <v-btn color="blue" v-bind="attrs" v-on="on"> User Type </v-btn>
</template>
<v-list>
 <v-list-item-group v-model="user_type">
   <v-list-item v-for="(item, index) in items" :key="index">
     <v-list-item-title>{{ item.title }}</v-list-item-title>
   </v-list-item>
</v-list>
</v-menu>

Leave a comment