Split an array into chunks using this custom filter for Vue.js.
With npm
$ npm install vue-chunk --save
If you are using Vue globally, just include vue-chunk.js, and it will automatically install the chunk filter.
Vue.use(require('vue-chunk')); // Filter is now available globally
Meant to be used with v-repeat, this filter splits the array of data into smaller chunks of data. It accepts one argument, which specifies the size of the chunks of data. For example...
<div v-repeat="row: rows | chunk 4">
<div v-repeat="item: row">
{{ item }}
</div>
</div>