简体   繁体   中英

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

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM