1.0.0 • Published 4 years ago

vue-paginater v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

VuePaginater - vue-paginater

npm (scoped) npm MIT

Installation via NPM

First

Install via NPM

npm i vue-paginater --save-dev

or

npm i  vue-paginater --save

Second

Require in your project:

var VuePaginater = require('vue-paginater');

or ES6 syntax:

import VuePaginater from 'vue-paginater'

Third

You can register the component globally:

Vue.component('vue-paginater', VuePaginater)
                                                

Or locally in a single Vue component:

 components: { 'vue-paginater':VuePaginater},

All Available Props for vue-paginater

PropTypeDefaultDescription
maxVisibleButtonsNumber3Amount of pages to show in pagination
totalNumber-Total amount of results or iteration count
maxNumber0If totalPages unset you must set how many entries you are showing per page i.e. 10 lines per page
enablePageListingBooleantrueshow page numbers ?
enableFirstPageBooleantrueshow first Button taking user to page 1?
enableLastPageBooleantrueshow last Button taking user to last page ?
firstLabelStringFirstText to show as First button
lastLabelStringLastText to show as Last button
nextLabelStringNextText to show as Next button
previousLabelStringPreviousText to show as Previous button
disabledBooleanfalseDisable pagination

Events

EventDescription
@offsetGives you back your current offset to go off and retrieve records from
@pagechangedgives you current page number - but not really needed by you

Usage

Example 1: Basic
<vue-paginater total="300" max="10" @offset="giveOffset"/>
<script>
 import VuePaginater from 'vue-paginater'
 export default {
     components: {
         VuePaginater
     },
     methods: {
        giveOffset(offset) {
            console.log('currentOffet '+offset)
            //MyService.fetch('balh?offset='+offset)
        }
    }
 }
</script>

Changelog

v.1.0.0

  • Working release built on webpack 4 - includes vue-paginater

Credits

Filipa Lacerda

This was the origins