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

vue-loadmore-simple

v1.2.8

Published

基于vue开箱即用的全局组件下滑加载更多无限滚动、下拉刷新,可自定义无数据时的文案和图标(默认含有)

Downloads

28

Readme

issues forks stars npm downloads npm bundle size github last commit

基于vue开箱即用的全局组件上滑无限滚动加载更多、下拉刷新
下图gif可能有卡顿,图片原地址

+ 若适用就来个star吧

使用方法

首先项目中安装:npm install vue-loadmore-simple -S

//main.js
import LoadMore from 'vue-loadmore-simple'
Vue.use(LoadMore)
//template
<template>
    <load-more 
        :pageIndex="pageIndex" 
        :pageSize="pageSize" 
        :totalCount="totalCount" 
        :openRefresh="true"
        @refresh="refresh"
        @loadmore="loadmore">

        <div v-for="(item,index) in list" :key="index">
            ...
        </div>
        
    </load-more>
</template>
<script>
export default {
    data() {
        //注意:当含有上图gif中tab切换或者筛选功能时,请初始化this.totalCount=-1;this.pageIndex=1
        return {
            pageIndex: 1,
            pageSize: 10,
            totalCount: 0
        }
    },
    methods:{
        loadmore(pageIndex){
            //上滑加载更多,pageIndex为下一页页码,
            this.pageIndex = pageIndex
            console.log('加载更多中...')
        },
        refresh(){
            console.log('您下拉刷新了')
        }
    },
}
</script>
- 注意:当含有上图gif中tab切换或者筛选功能时,请初始化this.totalCount=0;this.pageIndex=1 

参数如下

  • :pageIndex:页码 (必选)
  • :pageSize:页的大小(必选)
  • :totalCount:总条数(必选)
  • :openRefresh:true,默认false,只有开启以后才能启动下拉刷新*

回调函数

  • @loadmore:下滑到底时的回调,回调中的参数是下一页的页码
  • @refresh:下拉刷新

github链接 链接名称