# wx.showLoading(Object object)
Start from base library version 1.1.0. Please remaining backward compatible.
Displays the loading prompt box. wx.hideLoading must be called to close the prompt box.
# Parameters
# Object object
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
title | string | Yes | Prompt content | |
mask | boolean | false | No | Indicates whether to display a transparent mask to prevent touch penetration |
success | function | No | The callback function for a successful API call | |
fail | function | No | Callback function for failed API call | |
complete | function | No | Callback function used when API call completed (always executed whether call succeeds or fails) |
# Sample Code
wx.showLoading({
title: 'Loading',
})
setTimeout(function () {
wx.hideLoading()
}, 2000)
# Notes
Either - wx.showLoading or wx.showToast can be displayed.
- wx.showLoading should be paired with wx.hideLoading.