Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vuesimple/vs-pagination

Package Overview
Dependencies
Maintainers
0
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vuesimple/vs-pagination

A simple vue pagination

  • 3.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
271
increased by17.32%
Maintainers
0
Weekly downloads
 
Created
Source

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.js

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

Keywords

FAQs

Package last updated on 27 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc