1

I have this array

 appRightZone: [
                {label:"Third", value: 50, editable: true},
                {label:"Contacts", value: 100, editable: true},
                {label:"Actions", value: 200, editable: true},
                {label:"Leads", value: 250, editable: true},
                {label:"Deals", value: 300, editable: true},
                {label:"Quotes", value: 400, editable: true}],

i'm looping through this array to have multiple v-select

  <v-container v-for="select in appRightZone" fluid>
                <span class="font-weight-bold">{{select.label}}</span>
                <v-col cols="10">
                    <v-select return-object v-model="selectedRightType" :items="appRightType" item-text="label" item-value="code" value="code" outlined dense hide-details >
                    
                    </v-select>
                </v-col>
             </v-container>

the values available in the v-select is this array

appRightType: [
                {label:"None", code: 0},
                {label:"User can create", code: 1000},
                {label:"User can only read", code: 5000},
                {label:"User can create and read", code: 5500},
                {label:"User can create, read and delete", code: 6000},
            ]

Finally, i have an api call and the response is an array of user, these users only have a code corresponding to the codes from the appRightType array above.

What i'm trying to do, is to put as the default value in the v-select, the right object of the appRightType corresponding to the code from the user. I don't know if it makes sens so please feel free to ask anything if you didn't understand

0 Answers0