Vuetify v-select attribute type check fails
<p>When I use v-select in Vuetify 3, I often encounter the following error: </p>
<blockquote>
<p>[Vue warning]: Invalid prop: Type check failed for prop 'title'. Expected String | Number | Boolean but got Object</p><p>
In <VListItem key=0 title=`</p>
</blockquote>
<p>I'm not sure what the problem is. I'm getting an array of objects from a backend API as my JSON response. My goal is to display all the usernames in the dropdown, but when I select an item in the dropdown, I want to store the entire object in a variable. For example, if I select the "Desmond" username in the dropdown menu, I want the objects related to Desmond to be stored, i.e. <code>{"username": "Desmond","email": " desmond@test.com"}</code></p>
<pre class="lang-js prettyprint-override"><code><v-select
v-model="selectedItem"
:items="items"
name="username"
item-text="username"
label="Select Item"
return-object
></v-select>
</code></pre>
<pre class="brush:php;toolbar:false;"><script>
import axios from "axios";
export default {
name: "Testing123",
data() {
return {
items: [],
selectedItem: null,
};
},
created() {
this.fetchItems();
},
methods: {
fetchItems() {
axios
.get("http://localhost:5000/items", config)
.then((response) => {
this.items = response.data
})
.catch((error) => {
console.error(error);
});
},</pre>
<p>This is my<code>response.data</code></p>
<pre class="brush:php;toolbar:false;">[
{
"username": "Eric",
"email": "eric@test.com",
},
{
"username": "Desmond",
"email": "desmond@test.com",
},
]</pre></p>