Parameters
Code Example
Related APIs
my.hideToast
Hide toast
my.showLoading
Show loading indicator
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Display a toast notification that disappears after a specified duration.
| Property | Type | Required | Description |
|---|---|---|---|
| content | String | No | Toast message content |
| type | String | No | Toast type: success, fail, exception, none (default: none) |
| duration | Number | No | Display duration in ms (default: 2000) |
| success | Function | No | Callback on success |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
// Success toast
my.showToast({
type: 'success',
content: 'Saved successfully',
duration: 2000
});
// Error toast
my.showToast({
type: 'fail',
content: 'Operation failed',
duration: 3000
});
// Plain text toast
my.showToast({
content: 'Loading complete'
});