micheal
micheal

Reputation: 177

Vuetify Autocomplete, accept value outside list

I have a vuetify autocomplete component that displays a list of names that the user selects from. I would like a fallback case where if the user enters something not on the list that value is still accepted. Here is my code:

<v-autocomplete
v-model="model.name"
:items="users"
placeholder="Enter your name"
no-data-text="Name not Found"
clearable
></v-autocomplete>

Where the value of the autocomplete is bound to a data variable and the items is an array coming from my server. The autocomplete component is part of a larger form that accepts submissions of data

Upvotes: 4

Views: 3800

Answers (1)

Luthfiarfi
Luthfiarfi

Reputation: 86

you can try using v-combobox instead of v-autocomplete. v-combobox accept values entered by user that do not exist within provided items.

src: https://vuetifyjs.com/en/components/combobox/

Upvotes: 7

Related Questions