Vue: Filters not working with 'v-for'

Created on 28 Apr 2017  路  3Comments  路  Source: vuejs/vue

Vue.js version
2.1.10

Reproduction Link
http://codepen.io/sumitridhal/pen/ybVGZa?editors=1010

What is Expected?
filterBy OR limit filters not working with v-for

v-for='(item, index) in filteredItems | filterBy search'
<input type="text" class="form-control medium" v-model="search">'

What is actually happening?
application not loading...

Most helpful comment

For your case you should use computed property = filtered array

All 3 comments

Hello, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue - thank you!

Filters can only be inside interpolations i.e. mustache brackets {{ myVar | myFilter}} or in v-bind expressions <div v-bind:id="someId | someIdFilter"></div>

https://vuejs.org/v2/guide/syntax.html#Filters

Scott

For your case you should use computed property = filtered array

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bfis picture bfis  路  3Comments

julianxhokaxhiu picture julianxhokaxhiu  路  3Comments

bdedardel picture bdedardel  路  3Comments

paulpflug picture paulpflug  路  3Comments

wufeng87 picture wufeng87  路  3Comments