A pull down refresh component implements by vuejs.
npm install vue-awesome-pull-refreshbash
npm install vue-awesome-pull-refresh --save
`
$3
`javascript
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: ' '
});
`
$3
`javascript
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: ' '
});
`
$3
| 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
``