1.1.2 • Published 6 years ago

vue-pagination-simple v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

vue-pagination-simple

Simple pagination vue component

Installation


npm

npm install --save vue-pagination-simple

Usage


<template>
	<div>
		<app-pagination class="center"
    		:current="currentPage" 
    		:total="totalPages" 
    		:page-range="pageRange"
    		:active-font-color="'black'"
    		:active-color="'#007DFF'"
    		@page-changed="changePage"
    	></app-pagination>
	</div>
</template>

<script>
export default {
	name: 'app',
	data () {
		return {
			currentPage: 6,
			totalPages: 10,
			pageRange: 2
		}
	},
	methods: {
		changePage(page) {
			console.log(`page changed on ${page}`);
			this.currentPage = page;
		}
	}
}
</script>

<style scoped>

// you can add style of pagination hover and border by class .pagination

.pagination a:hover:not(.active) {
	background-color: #ddd;
}

.pagination a {
	border: 1px solid #ddd;
}

.center {
  display: flex;
  justify-content: center;
}

</style>

Example


1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago