Answer the question
In order to leave comments, you need to log in
How to fix display with filterBy, Laravel and Vue.js?
There is this code
<div id="app">
<input type="text" v-model="input">
<ul>
<li v-for="item in array">@{{ item.name }}</li>
</ul>
</div>
new Vue({
el: '#app',
data: {
input: '',
array: [
{
name: 'Agel',
ag: 23
},
{
name: 'Mark',
ag: 26
}
]
}
});
<li v-for="item in array | filterBy 'name'">@{{ item.name }}</li>
<div id="app"></div>
Answer the question
In order to leave comments, you need to log in
What version of vue are you using? If 2.0+, then vue.js refused to include native filters in the code (Probably due to a vulnerability or file weight). And instead, they suggest using third-party functions (libraries). https://lodash.com/docs/4.17.4#filter . It's a pity that they were removed, but you can write them yourself, make a custom filter, but here again, you need to use the filter as a function, that is, pass it as attributes in parentheses . Read about filters in the docks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question