1.1.1 • Published 3 years ago
@uni/toast v1.1.1
toast
Universal toast, you can choose how many seconds after disappearing
Support
Install
$ npm install @uni/toast --saveUsage
import { showToast, hideToast } from '@uni/toast';
showToast('Hi');
hideToast();Methods
showToast(options: object | string)
Arguments
| Property | Type | Description | Default |
|---|---|---|---|
| content | string | content of the message | - |
| type | string | Type of popup | none |
| duration | number | Time in millisecond before Toast is closed. | 2000 |
| success | function | The callback function for a successful API call | - |
| fail | function | The callback function for a failed API call | - |
| complete | function | The callback function used when the API call completed (always executed whether the call succeeds or fails) | - |
Valid type
| Value | Description | Support | No Support |
|---|---|---|---|
| success | Show success icon | ||
| fail | Show fail icon | ||
| loading | Show loading icon | ||
| none | No icon |
Special Arguments
| Property | Type | Description | Default | Support |
|---|---|---|---|---|
| image | string | The local path of the custom icon, the priority of image is higher than icon | - | |
| mask | boolean | Whether to display a transparent mask to prevent touch penetration | none |
hideToast()
Hides the loading prompt box
1.1.1
3 years ago
1.1.1-beta
4 years ago
1.1.0
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.6-beta
4 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago
1.0.0-beta1
5 years ago
1.0.0-beta
5 years ago