My v-select
's data is an array of objects. For each item, the value
is one property and the text
for that item is a different property. However I really need to retrieve both, not just the value
.
So I guess I need to retrieve the object. Is it possible?
V-select code:
<v-select
:items="projects"
v-model="project"
item-text="projectName"
item-value="projectId"
solo
></v-select>
This is how the array of items is populated (in mounted hook):
querySnapshot.forEach((doc) => {
let data = {
'projectId': doc.id,
'projectName': doc.data().name,
'clientId': doc.data().clientId
}
this.projects.push(data);
});
Add return-object
prop:
<v-select return-object>
See docs:
https://vuetifyjs.com/en/components/selects#example-custom-text-and-value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With