I have a v-select that maps objects this way:
<v-select
v-model="object"
:items="objectsArray"
label="Select Object"
item-text="name"
item-value="id"
></v-select>
Where:
- object have this structure: {'id': 'Foo','name':'Bar'}
- And ObjectsArray is an array of objects with the same structure {'id': 'Foo','name':'Bar'}
Here is the thing: When initial render happens works fine displaying the name property in the select, but when change object becomes a string with the 'name' of the selected Item i.e. 'Bar' .
Questions: 1-How can object be replaced with the full value of selected items i.e: {'id':'Foo','name':'Bar'} instead of the item-text property only. 2-How can object be replaced with id property only i.e.'Foo'.
Observation:
If removes item-text form v-select. Shows [Object object] on the select BUT on change updates object with the item-value property in this case the id.