I've upgraded to Vue.js 2.0.5 and orderBy in a v-for seems to not be working anymore
<li v-for="c in rooms | orderBy 'last_iteraction'">
outputs
- invalid expression: v-for="c in rooms | orderBy 'last_iteraction'"
anyone knows how to solve?
I've upgraded to Vue.js 2.0.5 and orderBy in a v-for seems to not be working anymore
<li v-for="c in rooms | orderBy 'last_iteraction'">
outputs
- invalid expression: v-for="c in rooms | orderBy 'last_iteraction'"
anyone knows how to solve?
orderBy Filter is removed in vue.js v-2.
Quoted from vue.js docs
Instead of:
Use lodash’s orderBy (or possibly sortBy) in a computed property:
Reference:
https://vuejs.org/v2/guide/migration.html#Replacing-the-orderBy-Filter
You can also use vue2 filters package.
1) First install it using npm.
2) Then, add it in your component or globally.
3) After that use it in the template
There is a list of predefined filters.check it out.
Reference:
https://github.com/freearhey/vue2-filters