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

@sanonz/vue-paginator

v1.1.0

Published

vue paginator component

Downloads

5

Readme

ReduxStoreProvider

npm Github file size npm

Vue 简约分页插件,整个组件代码只有 100 多行,非常精简,此组建的诞生是有洁癖症患者的福音。

安装

npm install @sanonz/vue-paginator --save

手册

<style>
.paginator-wrap{display:inline-block;margin-top:100px;}
.paginator-wrap a{cursor:pointer;color:#2cd6ff;user-select:none}
.paginator{list-style-type:none;padding:0;color:#333;line-height:100%;overflow:hidden;border:1px solid #e2e2e2;border-radius:4px;}
.paginator-item{float:left;border-right:1px solid #e2e2e2;}
.paginator-item:last-child{border-right:none;}
.paginator-active{background-color:#f3f3f3;}
.paginator-row{display:block;padding:6px 12px;}
</style>

<template>
  <div class="paginator-wrap">
    <paginator
      :range="2"
      :page="page"
      :size="20"
      :total="2000"
      prevText="Prev"
      nextText="Next"
      @change="onPageChange"
    />
  </div>
</template>

<script>
  import Paginator from '@sanonz/vue-paginator';


  export default {
    components: {
      Paginator,
    },
    data: function() {
      return {
        isMounted: false,
      };
    },
    mounted: function() {
      this.isMounted = true;
    },
    beforeDestroy: function() {
      this.isMounted = false;
    },
    methods: {
      onPageChange(page) {
        this.page = page;
      },
    },
  };
</script>

参数

| Name | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | page | Number | null | true | 当前页码,在路由中可以使用 this.$route.query.page 获取 | | size | Number | 20 | false | 每页展示条数 | | total | Number | null | true | 总条数 | | range | Number | 2 | false | 当前页码左右两侧的页面展示个数 | | prevText | String | 上一页 | false | 上一页显示文本 | | nextText | String | 下一页 | false | 下一页显示文本 |

例子

https://sanonz.github.io/vue-paginator/examples/