vpr

vue-pull-refresh

A pull down refresh component implement by vuejs

Showing:

Popularity

Downloads/wk

669

GitHub Stars

130

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

1

Size (min+gzip)

7.8KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

vue-pull-refresh

Build Status

A pull down refresh component implements by vuejs 2.0 for mobile.

Demo

Demo

PS: Please use browsers that support Promise

Usage

Install

npm install vue-pull-refresh --save

CommonJS

var VuePullRefresh = require('vue-pull-refresh');

new Vue({
    components: {
        'vue-pull-refresh': VuePullRefresh
    },
    data: function () {
        return {};
    },
    methods: {
        onRefresh: function() {
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    resolve();
                }, 1000);
            });
        }
    },
    template: '<vue-pull-refresh :on-refresh="onRefresh"></vue-pull-refresh>'
});

ES6

import VuePullRefresh from 'vue-pull-refresh';

new Vue({
    components: {
        'vue-pull-refresh': VuePullRefresh
    },
    data: function () {
        return {};
    },
    methods: {
        onRefresh: function() {
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    resolve();
                }, 1000);
            });
        }
    },
    template: '<vue-pull-refresh :on-refresh="onRefresh"></vue-pull-refresh>'
});

Props

PropertyDescription
onRefreshrefresh event;Should return a promise.
config{
errorLabel: label shows when error
startLabel: label shows when pull down start
readyLabel: label shows when ready to refresh
loadingLabel: label shows when loading
pullDownHeight: the height toggle pull down refresh action
}

Contribution

First, install dependencies

npm install

Second, setup development environment

npm run dev

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100