Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getMenuButtonBoundingClientRect问题和css选择器问题 #15

Open
zhongjiajian opened this issue Nov 16, 2019 · 1 comment
Open

getMenuButtonBoundingClientRect问题和css选择器问题 #15

zhongjiajian opened this issue Nov 16, 2019 · 1 comment

Comments

@zhongjiajian
Copy link

zhongjiajian commented Nov 16, 2019

  1. 在ios7.0.3版本,iPhone 6s机型下,getMenuButtonBoundingClientRect有时候会报错,有时候取到的值都为0,所以在你的try catch中加了一条:
    try { rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null; if (rect === null) { throw 'getMenuButtonBoundingClientRect error'; } //取值为0的情况 if (!rect.width){ throw 'getMenuButtonBoundingClientRect error'; } }

  2. 组件中不能使用标签等选择器,你的navBar.wxss是有标签选择器的。

@lingxiaoyi
Copy link
Owner

多谢,getMenuButtonBoundingClientRect有时候取到的值都为0的情况已修复,标签选择器主要是这个代码
view,
text,
scroll-view,
input,
button,
image,
cover-view {
box-sizing: border-box;
}
主要是为了padding值算在width里,
我把这个 box-sizing: border-box;已经放到其他元素里了,为了防止不必要的错误暂时不会移除这个代码,这个代码可能会影响引用此组件的页面上元素的样式,稍注意一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants