selectPreviousSearch(index) {
this.search = this.searchHistory[index];
this.showSearchHistory = false;
},
<input class="form-control bg-light-blue" id="SearchText" type="text" v-model="search"
@keydown.enter = 'enter'
@click="onClick"
@keyup.enter="processSearch"
@input = 'change'
@keyup="inputChanged"
@keydown.down="onArrow"
@keydown.up="onArrow"
/>
<ul class="list-group" v-if="showSearchHistory">
<li class="list-group-item" v-for="(item, index) in searchHistory" :key="index"
@click="selectPreviousSearch(index)">{{ item }}</li>
</ul>
I need to limit the number of items stored in the list to five for the li tag.
Essentially, I am designing an input field where any character typed by the user will be saved in a list.
For each li element, I aim to enforce a restriction that only five items can be stored in selectPreviousSearch.