A sliding Pagination Vue Component

Description:

An accessible (ARIA-friendly) pagination component for Vue.js application to paginate any content with a fancy pagination experience.

Install & Download:

# Yarn
$ yarn add vue-sliding-pagination

# NPM
$ npm install vue-sliding-pagination --save

How to use it:

  1. Import the vue-sliding-pagination component in your app.
import SlidingPagination from 'vue-sliding-pagination'
  1. Add the pagination component to the template as follows:
<template>
  <sliding-pagination
    :current="current"
    :total="total"
    @page-change="onPageChange"
  >
  </sliding-pagination>
</template></pre>

<pre>export default {
  name: 'SimpleExample',
  components: {
    SlidingPagination
  },
  data() {
    return {
      current: 1,
      total: 10
    }
  },
  methods: {
    onPageChange (page) {
      this.current = page
    }
  }
}
  1. Default props to config the pagination controls.
ariaPaginationLabel: {
  type: String,
  required: false,
  default: 'Pagination Navigation'
},
ariaGotoPageLabel: {
  type: String,
  required: false,
  default: 'Go to page %page% of %total%'
},
ariaPreviousPageLabel: {
  type: String,
  required: false,
  default: 'Go to previous page'
},
ariaNextPageLabel: {
  type: String,
  required: false,
  default: 'Go to next page'
},
ariaCurrentPageLabel: {
  type: String,
  required: false,
  default: 'Page %page% of %total%, current page'
},
classMap: {
  type: Object,
  required: false,
  default: () => {
    return defaultClassMap
  }
},
current: {
  required: true,
  type: Number
},
total: {
  required: true,
  type: Number
},
slidingEndingSize: {
  required: false,
  type: Number,
  default: 2
},
slidingWindowSize: {
  required: false,
  type: Number,
  default: 3
},
nonSlidingSize: {
  required: false,
  type: Number,
  default: 9
},
pageComponent: {
  required: false,
  type: String,
  default: 'sliding-pagination-default-page'
}

Download Details:

Author: eFrane

Live Demo: https://vue-sliding-pagination.efrane.com/examples.html#very-basic-example

Download Link: https://github.com/eFrane/vue-sliding-pagination/archive/master.zip

Official Website: https://github.com/eFrane/vue-sliding-pagination

#vuejs #javascript #vue-js #vue

A sliding Pagination Vue Component
20.00 GEEK