HomeDocs
Skip to main content

Show Loading Toast

methodName: showLoading​

Note: You need to actively call hideLoading to close the loading toast. Otherwise, it will automatically close after the specified duration.

Additional Parameters:​

PropertyTypeRequiredDefaultDescription
titleStringNoContent of the loading toast
durationNumberNo3500Duration of the loading toast in milliseconds
maskBooleanNotrueWhether to show a transparent mask to prevent touch events

Success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure.

Fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure.
errMsgStringError message.

Example Usage​

const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();

if (canCallDlt) {
dlt.callApi('showLoading', {
title: 'Loading title',
duration: 5000,
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.