Home > front end >  How to search for a value that isnt as item in a v-autocomplete
How to search for a value that isnt as item in a v-autocomplete

Time:10-06

I have a v-autocomplete:

    <v-autocomplete
              v-model="fromPrice"
              :items="listOfFromItems"
              dense
              solo
              label="from"
              hide-details
              return-object
              color="red darken-1"
            />

I have populated with a list like this:

for (let i = 0; i <= 5000; i  = 50) {
  this.listOfFromItems = [...this.listOfFromItems, i];
}

 [0, 50, 100, 150.......5000]

I want to make something like that, when I write a number (for example 12) which in not in the array, the value of v-autocomplete will be the written number, 12. Any help would be appreciated :)

CodePudding user response:

The component you're looking for is called Combobox.

  • Related