Taro.setEnableDebug(res)
Sets whether to enable/disable debugging switch that also takes effect in the official version.
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 debugging
Taro.setEnableDebug({
enableDebug: true
})
// Turn off debugging
Taro.setEnableDebug({
enableDebug: false
})
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.setEnableDebug | ✔️ |