set-enable-debug.md 859 字节
Newer Older
M
mehaotian 已提交
1 2 3 4 5 6
### uni.setEnableDebug(OBJECT)

设置是否打开调试开关。此开关对正式版也能生效。

**平台差异说明**

雪洛's avatar
雪洛 已提交
7
|App|H5|微信小程序|支付宝小程序|百度小程序|头条小程序|QQ小程序|
W
wanganxp 已提交
8 9
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|x|√|x|√|x|√|
M
mehaotian 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

**OBJECT说明**

| 属性 | 类型 | 必填 | 说明 |平台差异说明|
| --- | --- | --- | --- | --- |
| enableDebug | boolean| 是 | 是否打开调试 ||
| success | function| 否 | 接口调用成功的回调函数 |微信小程序|
| fail | function| 否 | 接口调用失败的回调函数 |微信小程序|
| complete | function| 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |微信小程序|

#### 示例代码
```js
// 打开调试
uni.setEnableDebug({
    enableDebug: true
})
// 关闭调试
uni.setEnableDebug({
    enableDebug: false
})
```