Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API on/off debugging


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.setEnableDebug(OBJECT)

Base library 1.4.0 starts to support, and low versions need to be compatible

Set whether to turn on the debug switch, which also takes effect for the official version.

OBJECT parameter description:

The name of the argument Type Required Description
enableDebug Boolean Is Whether to turn on debugging
success Function Whether The interface calls a successful callback function
fail Function Whether The interface calls the failed callback function
complete Function Whether Callback function at end of interface call (call succeeds, fails are executed)

Success returns a description of the parameters:

The name of the argument Type Description
errMsg String The result of the call

Example code:

// 打开调试
wx.setEnableDebug({
    enableDebug: true
})

// 关闭调试
wx.setEnableDebug({
    enableDebug: false
})