title: Taro.setEnableDebug(res)

sidebar_label: setEnableDebug

Sets whether to enable/disable debugging switch that also takes effect in the official version.

Reference

Type

  1. (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

  1. // Turn on debugging
  2. Taro.setEnableDebug({
  3. enableDebug: true
  4. })
  5. // Turn off debugging
  6. Taro.setEnableDebug({
  7. enableDebug: false
  8. })

API Support

API WeChat Mini-Program H5 React Native
Taro.setEnableDebug ✔️