0.0.10 • Published 1 year ago

@svifty7/vue-paginate v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

vue-paginate

Vue 3 component to make pagination. Fork of vuejs-paginate.

Easy to use by providing simple api, and you can customize the style of this component by CSS.

See Documentation & Demo

Installation

NPM

Install the npm package.

npm install @svifty7/vue-paginate --save

Register the component

import { createApp } from 'vue';
import VuePaginatePlugin from '@svifty7/vue-paginate';

const app = createApp();

app.use(VuePaginatePlugin);

or use directly in component

<template>
  <vue-paginate :page-count="20" />
</template>

<script setup>
  import { VuePaginate } from '@svifty7/vue-paginate';
</script>

Props

Name                                       TypeDescription
page-countNumberTotal count of pages. required
page-rangeNumberRange of pages which displayed. default: 3 (Note: It is recommended to use an odd number, so that the same number of pages are displayed before and after the active page. If using an even number, there will be one more page number before the active page than after the current page)
margin-pagesNumberThe number of displayed pages for margins. default: 1
prev-textStringText for the previous button. You can use HTML here. default: Prev
next-textStringText for the next button. You can use HTML here. default: Next
break-view-textStringText for the break view indicator. default: ...
force-pageNumberThe page number of overridden selected page.
click-handlerFunctionThe method to call when page clicked. Use clicked page number as parameter.
container-classStringCSS class name for the layout.
page-classStringCSS class name for tag li of each page element.
page-link-classStringCSS class name for tag a of each page element.
prev-classStringCSS class name for tag li of previous element.
prev-link-classStringCSS class name for tag a of previous element.
next-classStringCSS class name for tag li of next element.
next-link-classStringCSS class name for tag a of next element.
break-view-classStringCSS class name for tag li of break view element.
break-view-link-classStringCSS class name for tag a of break view element.
active-classStringCSS class name for active page element. default: active
disabled-classStringCSS class name for disabled page element. default: disabled
no-li-surroundBooleanSupport no li tag surround a tag. default: false
first-last-buttonBooleanSupport buttons to turn to the first and last page. default: false
first-button-textStringText for first button. (Not visible when first-last-button is false. You can use HTML here.) default: 'First'
last-button-textStringText for last button. (Not visible when first-last-button is false. You can use HTML here.) default: 'Last'
hide-prev-nextBooleanHide prev/next button when there is no previous or next page. default: false

Customize inner HTML (experimental)

You can customize the inner HTML of the first page button, previous page button, next page button, last page button and break view indicator, with the slot tag.

Slot names

NameDescription
first-button-textFirst page button
prev-textPrevious page button
breakViewContentBreak view indicator
next-textNext page button
last-button-textLast page button
0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago