获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。

获取胶囊按钮的宽高,上下左右的距离

const res = wx.getMenuButtonBoundingClientRect()

console.log(res.width)  // 宽度
console.log(res.height)  // 高度
console.log(res.top)  // 上边界坐标
console.log(res.right)  // 右边界坐标
console.log(res.bottom)  // 下边界坐标
console.log(res.left)  // 左边界坐标

 结果:

猜你喜欢

转载自blog.csdn.net/qq_52421092/article/details/131035124
今日推荐