dlt.enableRefresh
Introduction
Enable or disable the pull-down refresh feature.
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| enable | boolean | false | No | true to enable, false to disable. |
| success | function | No | Callback function for a successful API call. | |
| fail | function | No | Callback function for a failed API call. | |
| complete | function | No | Callback function that will be executed when the API call ends (both success and failure). |
object.success Callback Function
Parameters
Object res
| Property | Type | Description |
|---|---|---|
| success | string | true-Set successfully. |
object.fail Callback Function
Parameters
Object res
| Property | Type | Description |
|---|---|---|
| success | string | false-Set failed. |
Sample Code
// pages/index/index.js
Page({
onLoad() {
dlt.enableRefresh({
enable: true,
});
},
});