my.showToast
Show the toast dialog, which disappears with the specified duration.
Sample Code
copy
my.showToast({
type: 'success',
content: 'Success',
duration: 3000,
success: () => {
my.alert({
title: 'toast is missing',
});
},
});
Parameters
Property | Type | Required | Description |
content | String | No | Text content. |
type | String | No | Toast type, showing the related icon, none by default, Supporting success /fail /exception /none Here. If it is exception , content is mandatory. |
duration | Number | No | Displaying duration, in ms, 2000 by default. |
success | Function | No | Callback function upon call success. |
fail | Function | No | Callback function upon call failure. |
complete | Function | No | Callback function upon call completion (to be executed upon either call success or failure). |