A Vue.js plugin to easily integrate pagination to your projects.
npm install vuejs-paginator -save
Register VPaginator component inside your Vue instance.
import VuePaginator from 'vuejs-paginator'
new Vue({
...
components: {
VPaginator: VuePaginator
},
...
});
Use it in your HTML.
<v-paginator :resource.sync="animals" :resource_url="api/animals"></v-paginator>
Then you will have access to the returned data inside your resource
variable, in this example animals, and you'll be able to render it as you would normally do.
<v-for="animal in animal">
{{ animal.name }}
</v-for>
# install dependencies
npm install
# build for production with minification
npm run build
# run unit tests
npm run unit
# run all tests
npm test