title: Taro.setEnableDebug(res)
sidebar_label: setEnableDebug
Sets whether to enable/disable debugging switch that also takes effect in the official version.
Reference
Type
(res: Option) => Promise<Promised>
Parameters
Option
| Property |
Type |
Required |
Description |
| enableDebug |
boolean |
Yes |
Indicates whether to enable debugging |
| complete |
(res: CallbackResult) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
| fail |
(res: CallbackResult) => void |
No |
The callback function for a failed API call |
| success |
(res: CallbackResult) => void |
No |
The callback function for a successful API call |
Promised
| Property |
Type |
Description |
| errMsg |
string |
call result |
Sample Code
// Turn on debuggingTaro.setEnableDebug({ enableDebug: true})// Turn off debuggingTaro.setEnableDebug({ enableDebug: false})
API Support
| API |
WeChat Mini-Program |
H5 |
React Native |
| Taro.setEnableDebug |
✔️ |
|
|