swan.setEnableDebug

API 实现差异。 解释:设置是否打开调试开关,此开关对正式版也能生效。

方法参数

Object object

object参数说明

示例

在开发者工具中预览效果

扫码体验

请使用百度APP扫码

图片示例

代码示例

-

  1. <view class="wrap"> <button type="primary" bindtap="openEnableDebug">openEnableDebug</button> <button type="primary" bindtap="closeEnableDebug">closeEnableDebug</button></view>

-

  1. Page({
  2. openEnableDebug() {
  3. swan.setEnableDebug({
  4. enableDebug: true
  5. })
  6. },
  7. closeEnableDebug() {
  8. swan.setEnableDebug({
  9. enableDebug: false
  10. })
  11. }
  12. });

- ``` .wrap { padding: 50rpx 30rpx; }

.wrap button { margin-bottom: 30rpx; } ```

Bug & Tip

  • -