I encountered the following error:
Uncaught TypeError: cloned[i].apply is not a function
at HTMLInputElement.invoker (vue.esm.js?65d7:1810)
I have set up my project using vue-cli (simple webpack), and below is the code for my component:
<template>
<div class="column is-4">
<nav class="panel">
<p class="panel-heading">
Authors in our library
</p>
<div class="panel-block">
<p class="control has-icons-left">
<input class="input is-small" type="text" placeholder="Search"
v-model="search"
@keyup="filterAuthors">
<span class="icon is-small is-left">
<i class="fa fa-search"></i>
</span>
</p>
</div>
<a class="panel-block is-active" v-for="author in filterAuthors">
<span class="panel-icon">
<i class="fa fa-book"></i>
</span>
{{ author }}
</a>
</nav>
</div>
</template>
<script>
export default {
data () {
return {
'search' : ''
}
},
computed: {
filterAuthors() {
let search = this.search.toLowerCase();
return this.$store.state.authors.filter((author) => {
return author.toLowerCase().indexOf(search) >= 0;
})
}
}
}
</script>
Despite the fact that the filter functionality is working, I keep receiving the mentioned error whenever I input text into the search field. Any suggestions on what could be causing this issue?