1.0.3 • Published 4 years ago

@uni/pull-down-refresh v1.0.3

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
4 years ago

onPullDownRefresh

npm

Turn on drop-down refresh. The drop-down refresh triggers the "pulldownrefresh" event.

Supported

Install

$ npm install @uni/pull-down-refresh --save

or

$ npm install @uni/apis --save

Usage

import { onPullDownRefresh } from '@uni/pullDownRefresh';

onPullDownRefresh();

You can also import from the big package:

import { pullDownRefresh } from '@uni/apis';

pullDownRefresh.onPullDownRefresh();

You can add event listener:

pullDownRefresh.onPullDownRefresh({eventCallback: cb});

Methods

onPullDownRefresh(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobject ✔️-
options.pullRefreshboolean The switch of manual pulldownRefreshtrue
options.triggerDistancenumber The pull-down distance required when the pull-down refresh is triggered90
options.eventCallbackFunction The callback function when the event is triggered-
options.successFunction The callback function for a successful API call-
options.failFunction The callback function for a failed API call-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

startPullDownRefresh

npm

Starts swipe-down-to-refresh.

Supported

Note: DingTalk miniprogram does not support startPullDownRefresh

Install

$ npm install @uni/pull-down-refresh --save

or

$ npm install @uni/apis --save

Usage

import { startPullDownRefresh } from '@uni/pullDownRefresh';

startPullDownRefresh();

You can also import from the big package:

import { pullDownRefresh } from '@uni/apis';

pullDownRefresh.startPullDownRefresh();

Methods

startPullDownRefresh(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobject ✔️-
options.successFunction The callback function for a successful API call-
options.failFunction The callback function for a failed API call-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

stopPullDownRefresh

npm

Disables swipe-down-to-refresh for the current page.

Supported

Install

$ npm install @uni/pullDownRefresh --save

or

$ npm install @uni/apis --save

Usage

import {stopPullDownRefresh} from '@uni/pullDownRefresh';

stopPullDownRefresh();

You can also import from the big package:

import { pullDownRefresh } from '@uni/apis';

pullDownRefresh.stopPullDownRefresh();

Methods

stopPullDownRefresh(options)

Arguments

PropertyTypeDescriptionrequiredDefaultSupported
optionsobject ✔️--
options.successFunction The callback function for a successful API call-
options.failFunction The callback function for a failed API call-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-