3.0.6 • Published 14 days ago

@vuesimple/vs-pagination v3.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

Vue Simple Pagination

🗃 A simple vue pagination.

A light weight vue plugin built with accessibility in mind.

npm npm

forthebadge forthebadge forthebadge forthebadge forthebadge forthebadge

📺 Live Demo

Code Sandbox: Link

🛠 Install

npm i @vuesimple/vs-pagination

🚀 Usage

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

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

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

🌎 CDN

<script src="https://unpkg.com/@vuesimple/vs-pagination@<version>/dist/vs-pagination.min.js"></script>
// Main/Entry file
app.use(VsPagination.plugin);
<template>
  <vs-pagination :total-pages="20" @change="changePage"></vs-pagination>
</template>

Nuxt Code Snippet

After installation,

  • Create a file /plugins/vs-pagination.js

    import Vue from 'vue';
    import VsPagination from '@vuesimple/vs-pagination';
    
    Vue.component('vs-pagination', VsPagination);
  • Update nuxt.config.js

    module.exports = {
      ...
      plugins: [
        { src: '~plugins/vs-pagination', mode: 'client' }
        ...
      ]
    }
  • In the page/ component

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

Note

  • For older Nuxt versions, use <no-ssr>...</no-ssr> tag if you are facing ssr issues.
  • You can also do import VsPagination from '@vuesimple/vs-pagination' & add in component:{VsPagination} and use it within component, without globally installing in plugin folder.

⚙ 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 slots:

NameDescription
leftIconLeft Icon slot
rightIconRight Icon slot
3.0.6

14 days ago

3.0.4

7 months ago

3.0.3

7 months ago

3.0.2

7 months ago

3.0.1

7 months ago

3.0.5

7 months ago

3.0.0

7 months ago

1.4.15

8 months ago

1.4.14

8 months ago

1.4.18

8 months ago

1.4.13

1 year ago

1.4.12

1 year ago

1.4.9

2 years ago

1.4.11

2 years ago

1.4.8

2 years ago

1.4.10

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

3 years ago

1.3.41

3 years ago

1.3.40

3 years ago

1.3.39

3 years ago

1.3.36

3 years ago

1.3.37

3 years ago

1.3.38

3 years ago

1.3.35

3 years ago

1.3.31

3 years ago

1.3.32

3 years ago

1.3.30

3 years ago

1.3.33

3 years ago

1.3.34

3 years ago

1.3.28

3 years ago

1.3.29

3 years ago

1.3.27

3 years ago

1.3.26

3 years ago

1.3.25

3 years ago

1.3.24

3 years ago

1.3.23

3 years ago

1.3.21

3 years ago

1.3.20

3 years ago

1.3.19

3 years ago

1.3.16

3 years ago