[微信小程序]wx.getMenuButtonBoundingClientRect(); 报错 [报给谁呀?]

- 当前 Bug 的表现(可附上截图)


- 预期表现


- 复现路径

//app.js

App({

onLaunch: function() {

// 展示本地存储能力

var logs = wx.getStorageSync('logs') || []

logs.unshift(Date.now())

wx.setStorageSync('logs', logs)


// 登录

wx.login({

success: res => {

// 发送 res.code 到后台换取 openId, sessionKey, unionId

}

})

// 获取用户信息

wx.getSetting({

success: res => {

if (res.authSetting['scope.userInfo']) {

// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框

wx.getUserInfo({

success: res => {

// 可以将 res 发送给后台解码出 unionId

this.globalData.userInfo = res.userInfo


// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回

// 所以此处加入 callback 以防止这种情况

if (this.userInfoReadyCallback) {

this.userInfoReadyCallback(res)

}

}

})

}

}

})

// 获取系统状态栏信息

wx.getSystemInfo({

success: e => {

this.globalData.StatusBar = e.statusBarHeight;

let custom = wx.getMenuButtonBoundingClientRect();

this.globalData.Custom = custom;

this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;

}

})

},

globalData: {

userInfo: null

}

})

- 提供一个最简复现 Demo


  • 你好,这边没有复现问题,重启一下开发工具能否解决问题呢?, 你也好~
    • 能帮忙看下为什么刚提的版本不能回退吗大佬 wxb9756e51bcd6d81c , 你若安好怎么得了
    • 重大BUG关注一下啊https://developers.weixin.qq.com/community/develop/doc/000e2a58830e080d1d383690e5b400, 聊天软件而已。