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

NameTypeMandatoryDescription
contentStringNoText content
typeStringNotoast type, showing the related icon, none by default, supporting success / fail / exception / none’ Here, exception type requires transfer of text information.
durationNumberNoDisplaying duration, in ms, 2000 by default
successFunctionNoCallback function upon call success
failFunctionNoCallback function upon call failure
completeFunctionNoCallback function upon call completion (to be executed upon either call success or failure)