I have a to-do list that consists of an array of objects with properties (id, title, description
). I want to display the title
in the v-autocomplete
, but when I search for a word, it works fine. However, what I actually want is to search for either the description
or the title
.
For example: if I type programming, it should display Read books.
Template
<v-autocomplete
v-model="idTodo"
:items="todos"
label="search todo..."
item-value="id"
item-text="title"
/>
Script
visitCategories: [],
todos: [
{ id: 1, title: "Read books", description: "read books related to programming" },
{
id: 2,
title: "watch tutorials",
description: "watch tutorials in many platforms like Youtube, Udemy...",
},
],
idTodo: -1,