has.startPullDownRefresh(Object object)
Triggers the pull-to-refresh. After this API is called, the pull-to-refresh animation is triggered. The effect is the same as that triggered by the user from the UI.
A UI-triggered pull-to-refresh will stop automatically within 4 seconds.
An API-triggered pull-to-refresh can be stopped by calling has.stopPullDownRefresh.
Since: 1.0.0
Parameters
The input parameter is an object containing the following fields.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| success | function | No | Callback triggered when the API call is successful. |
| fail | function | No | Callback triggered when the API call fails. |
| complete | function | No | Callback triggered when the API call is complete, regardless of success or failure. |
Error code information
| Error Code | Error Message |
|---|---|
| 30001101 | startPullDownRefresh error. Possible causes: 1.is already startPullDownRefresh. 2.config not enable pullDownRefresh. |
Example:
has.startPullDownRefresh({
success: () => {
console.info('startPullDownRefresh success');
},
fail: (err) => {
console.error('startPullDownRefresh fail', err);
},
complete: (res) => {
console.info('startPullDownRefresh complete', res);
}
}); has.stopPullDownRefresh(Object object)
Stops the pull-to-refresh on the current page.
Since: 1.0.0
Parameters
The input parameter is an object containing the following fields.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| success | function | No | Callback triggered when the API call is successful. |
| fail | function | No | Callback triggered when the API call fails. |
| complete | function | No | Callback triggered when the API call is complete, regardless of success or failure. |
Error code information
| Error Code | Error Message |
|---|---|
| 30001201 | stopPullDownRefresh error. |
Example:
has.stopPullDownRefresh({
success: () => {
console.info('stopPullDownRefresh success');
},
fail: (err) => {
console.error('stopPullDownRefresh fail', err);
},
complete: (res) => {
console.info('stopPullDownRefresh complete', res);
}
});