Skip to content

Demo


Install

bash
npm i @vuesimple/vs-pagination

Usage

html
<template>
  <vs-pagination :total-pages="20" @change="changePage"></vs-pagination>
</template>

<script>
  import VsPagination from '@vuesimple/vs-pagination';

  export default {
    components: {
      VsPagination,
    },
  };
</script>

CDN

html
<script src="https://cdn.jsdelivr.net/npm/@vuesimple/vs-pagination@3.1.6/dist/index.min.js"></script>
javascript
// Main/Entry file
app.use(VsPagination.plugin);
html
<template>
  <vs-pagination :total-pages="20" @change="changePage"></vs-pagination>
</template>

Props

NameTypeDefaultDescription
total-pagesNumber-Total count of pages. required
current-pageNumber1Sets the current page.
page-paddingNumber1Sets the number of pages that appear before and after active page between gap indicator.
page-gapNumber2Positions the leading and trailing gap indicator, based on the current and total pages.
hide-prev-nextBooleanfalseHide prev and next button on reaching first or last page.

Events

NameDescription
changeOn page change (return page value)

Slots

You can define own arrow icon markup via "#slot-name:

NameDescription
leftIconLeft Icon slot
rightIconRight Icon slot