1

I have a select menu and I pass it and object like this

color: [
    {value: 0, name:"red"},
    {value: 1, name:"blue"}
    ]

My select menu is :

<v-select
    label="Spectra Interpolation"
    v-model="selectedColor"
    :items="color"
    item-text="name"
    item-value="value"
    return-object
    >
</v-select>

In my selectedColor model, I want have the integer value of selected color for example if I choose red in menu , I want have 0 in my model. I want have a default value for 0 if the menu is not used. actually I retrieve the entire object.

thanks

TheDevGuy
  • 663
  • 2
  • 12
  • 25

1 Answers1

2

This is because you have the "return-object" attribute on the v-select. Remove that as having that "Changes the selection behavior to return the object directly rather than the value specified with item-value"

Neil.Work
  • 985
  • 7
  • 9