@uni/loading
v1.0.8
Published
Downloads
29
Readme
showLoading
Displays the loading prompt box.
Install
$ npm install @uni/showLoading --save
or
$ npm install @uni/apis --save
Usage
import showLoading from '@uni/showLoading';
showLoading({
content: 'loading...'
});
Methods
showLoading(options)
Supported
Arguments
| Property | Type | Description | required | Default | Supported |
| --- | --- | --- | --- | --- | --- |
| options | object
| | ✔️ | - | - |
| options.content | string
| Prompt content | ✘ | - | |
| options.mask | boolean
| Indicates whether to display a transparent mask to prevent touch penetration | ✘ | false | |
| options.delay | number
| Delay display, the unit is milliseconds (ms), the default value is 0. If my.hideLoading is called before this time, it will not be displayed | ✘ | 0 | |
| options.success | Function
| The callback function for a successful API call | ✘ | - | |
| options.fail | Function
| The callback function for a failed API call | ✘ | - | |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - | |
hideLoading
Hides the loading prompt box.
Install
$ npm install @uni/hideLoading --save
or
$ npm install @uni/apis --save
Usage
import hideLoading from '@uni/hideLoading';
hideLoading();
Methods
hideLoading(options)
Supported
Arguments
| Property | Type | Description | required | Default |
| --- | --- | --- | --- | --- |
| options | object
| | ✔️ | - |
| options.success | Function
| The callback function for a successful API call | ✘ | - |
| options.fail | Function
| The callback function for a failed API call | ✘ | - |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - |