vue-down-refresh

0.2.9 • Public • Published

vue-down-refresh

Vuejs 2.0 for mobile implements vue down refresh.

Usage

Install

npm install vue-down-refresh --save

CommonJS

var VueDownRefresh = require('vue-down-refresh');

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

ES6

import VueDownRefresh from 'vue-down-refresh';

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

Props

Property Description
onRefresh refresh 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

Package Sidebar

Install

npm i vue-down-refresh

Weekly Downloads

2

Version

0.2.9

License

ISC

Unpacked Size

43.4 kB

Total Files

20

Last publish

Collaborators

  • a53144boot