Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liuhuiashazj/pulltorefresh-vue
pulltorefresh vue版本
https://github.com/liuhuiashazj/pulltorefresh-vue
Last synced: 4 months ago
JSON representation
pulltorefresh vue版本
- Host: GitHub
- URL: https://github.com/liuhuiashazj/pulltorefresh-vue
- Owner: liuhuiashazj
- Created: 2018-02-05T03:08:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-06T07:58:05.000Z (about 7 years ago)
- Last Synced: 2024-10-01T20:09:15.497Z (5 months ago)
- Language: Vue
- Size: 293 KB
- Stars: 16
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pulltorefresh-vue 版本
> pull to refresh for Vue.js
# screenshot
# Requirements
- [Vue.js](https://github.com/yyx990803/vue) `^1.0.0`# Installation
## npm
``` bash
npm install pullToRefresh-vue
```
## parameters
```
down: if open pull down to refresh function
up: if open pull up to loadmore function
addNew: refresh callback, used to refresh or insert data to the lists
addMore: loadmore callback, used to loadmore data to the lists
hasMore: if there has more data, used to show pull up icon or 'nomore' message
```# Usage
``` html
here is the content of what you want to pull down to refresh or pull up to loadmore
may be some ul list
import PullToRefresh from 'pulltorefresh-vue';
export default {
/* other code */
name: 'pullDemo',
methods: {
addNew() {
return new Promise((resolve, reject) => {
this.getNewData().then(() => {
resolve();
});
});
},
addMore() {
let self = this;
return new Promise((resolve, reject)=> {
this.getMoreData().then(() => {
resolve();
});
});
},
}
/* other code */
}```