├── LoadMore.vue ├── README.md ├── index.js └── package.json /LoadMore.vue: -------------------------------------------------------------------------------- 1 | 21 | 182 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![issues](https://img.shields.io/github/issues/tanagang/vue-loadmore-simple)](https://github.com/tanagang/vue-loadmore-simple/issues) 2 | [![forks](https://img.shields.io/github/forks/tanagang/vue-loadmore-simple)](https://github.com/tanagang/vue-loadmore-simple) 3 | [![stars](https://img.shields.io/github/stars/tanagang/vue-loadmore-simple)](https://github.com/tanagang/vue-loadmore-simple) 4 | [![npm](https://img.shields.io/npm/v/vue-loadmore-simple)](https://www.npmjs.com/package/vue-loadmore-simple) 5 | [![downloads](https://img.shields.io/npm/dm/vue-loadmore-simple.svg)](https://www.npmjs.com/package/vue-loadmore-simple) 6 | [![npm bundle size](https://img.shields.io/bundlephobia/minzip/vue-loadmore-simple)](https://www.npmjs.com/package/vue-loadmore-simple) 7 | ![github last commit](https://img.shields.io/github/last-commit/tanagang/vue-loadmore-simple) 8 | 9 | 10 | 基于vue开箱即用的全局组件上滑无限滚动加载更多、下拉刷新 11 | 下图gif可能有卡顿,[图片原地址](https://file.40017.cn/tcyp/tz/refresh2.gif) 12 | ```diff 13 | + 若适用就来个star吧 14 | ``` 15 | 16 | ![](https://file.40017.cn/tcyp/tz/refresh2.gif) 17 | 18 | ### 使用方法 19 | 首先项目中安装:npm install vue-loadmore-simple -S 20 | ```javascript 21 | //main.js 22 | import LoadMore from 'vue-loadmore-simple' 23 | Vue.use(LoadMore) 24 | //template 25 | 40 | 62 | 63 | ``` 64 | ```diff 65 | - 注意:当含有上图gif中tab切换或者筛选功能时,请初始化this.totalCount=0;this.pageIndex=1 66 | ``` 67 | ### 参数如下 68 | * :pageIndex:页码 (必选) 69 | * :pageSize:页的大小(必选) 70 | * :totalCount:总条数(必选) 71 | * :openRefresh:true,默认false,只有开启以后才能启动下拉刷新* 72 | 73 | ### 回调函数 74 | * @loadmore:下滑到底时的回调,回调中的参数是下一页的页码 75 | * @refresh:下拉刷新 76 | 77 | *** 78 | github链接 79 | [链接名称](https://github.com/tanagag/vue-loadmore-simple) 80 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import LoadMoreComponent from './LoadMore.vue' 2 | var LoadMore = { 3 | install:function(Vue,options){ 4 | Vue.component('loadMore',LoadMoreComponent) 5 | } 6 | } 7 | export default LoadMore 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-loadmore-simple", 3 | "version": "1.2.7", 4 | "description": "基于vue开箱即用的全局组件下滑加载更多无限滚动、下拉刷新,可自定义无数据时的文案和图标(默认含有)", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/tanagag/vue-loadmore-simple" 12 | }, 13 | "keywords": [ 14 | "vue-loadmore", 15 | "loadmore", 16 | "refresh", 17 | "加载更多", 18 | "无限滚动", 19 | "上滑加载更多", 20 | "下拉刷新" 21 | ], 22 | "author": "tanzheng", 23 | "license": "ISC" 24 | } 25 | --------------------------------------------------------------------------------