npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vuesimple/vs-pagination

v3.0.7

Published

A simple vue pagination

Downloads

1,082

Readme

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

| Name | Type | Default | Description | | -------------- | ------- | ------- | ---------------------------------------------------------------------------------------- | | total-pages | Number | - | Total count of pages. required | | current-page | Number | 1 | Sets the current page. | | page-padding | Number | 1 | Sets the number of pages that appear before and after active page between gap indicator. | | page-gap | Number | 2 | Positions the leading and trailing gap indicator, based on the current and total pages. | | hide-prev-next | Boolean | false | Hide prev and next button on reaching first or last page. |

🔥 Events

| Name | Description | | ------ | ---------------------------------- | | change | On page change (return page value) |

📎 Slots

You can define own arrow icon markup via slots:

| Name | Description | | --------- | --------------- | | leftIcon | Left Icon slot | | rightIcon | Right Icon slot |