An accessible (ARIA-friendly) pagination component for Vue.js application to paginate any content with a fancy pagination experience.
# Yarn
$ yarn add vue-sliding-pagination
# NPM
$ npm install vue-sliding-pagination --save
import SlidingPagination from 'vue-sliding-pagination'
<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
}
}
}
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'
}
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