Im using filters for chunking arrays but errors pops up like this one
Vue.filter('chunk',(array, length) => {
return _.chunk(array,length);
});
and use it to my component
<transition-group v-for="data in dataList | chunk(3)"
class="row"
enter-active-class="animated bounceInRight"
leave-active-class="animated bounceOutRight">
<div class="col-xs-12 col-md-4" :key="data['.key']">
<md-card md-with-hover>
<slot :data="data"></slot>
</md-card>
</div>
</transition-group>
The component seems to be lacking access to the filter.
Are you exporting a plain object inside card.vue
? If you're doing something like export default Vue.component(...)
or export default Vue.extend(...)
then it's the cause of the problem.
If not, please follow the Issue Reporting Guidelines and provide a repo on github to reproduce the issue, thanks!
In 2.x filters only work in mustache interpolations and v-bind
.
${} - can't access filter. Thank you @yyx990803(Evan You).
Most helpful comment
In 2.x filters only work in mustache interpolations and
v-bind
.