1.0.2 • Published 6 years ago

vue-awesome-pull-refresh v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

vue-awesome-pull-refresh

Build Status FOSSA 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-awesome-pull-refresh --save

CommonJS

var VuePullRefresh = require('vue-awesome-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-awesome-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 errorstartLabel: label shows when pull down startreadyLabel: label shows when ready to refreshloadingLabel: label shows when loadingpullDownHeight: the height toggle pull down refresh action}

Contribution

First, install dependencies

npm install

Second, setup development environment

npm run dev

License

MIT

FOSSA Status