has.startPullDownRefresh(Object object)
下拉刷新接口。调用后触发下拉刷新动画,效果与用户手动触发一致。
起始版本: 1.0.0
参数:
参数为Object对象,包括以下字段。
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| success | function | 否 | 接口调用成功的回调函数。 |
| fail | function | 否 | 接口调用失败的回调函数。 |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行)。 |
错误码信息:
| 错误码 | 错误信息 |
|---|---|
| 30001101 | startPullDownRefresh error. Possible causes: 1.is already startPullDownRefresh. 2.config not enable pullDownRefresh. |
示例:
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)
停止当前页面下拉刷新。
起始版本: 1.0.0
参数:
参数为Object对象,包括以下字段。
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| success | function | 否 | 接口调用成功的回调函数。 |
| fail | function | 否 | 接口调用失败的回调函数。 |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行)。 |
错误码信息:
| 错误码 | 错误信息 |
|---|---|
| 30001201 | stopPullDownRefresh error. |
示例:
has.stopPullDownRefresh({
success: () => {
console.info('stopPullDownRefresh success');
},
fail: (err) => {
console.error('stopPullDownRefresh fail', err);
},
complete: (res) => {
console.info('stopPullDownRefresh complete', res);
}
});