We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
let query = wx.createSelectorQuery().in(this) let _this = this console.log(query.select) query.select('#move-box').boundingClientRect(function (rect) { console.log(rect) _this.maxWidth = rect.width console.log(_this.maxWidth) }).exec(res => { console.log(res) })
ready生命周期中,在子组件获取元素高度, 控制台
An SelectorQuery call is ignored because no proper page or component is found. Please considering using SelectorQuery.in to specify a proper one.
SelectorQuery.in
如果不使用in(this), 获取的rect是null
The text was updated successfully, but these errors were encountered:
2.0版本
Sorry, something went wrong.
let query = wx.createSelectorQuery().in(this.$wx) 改成this.$wx就行
this 拿到是是 wepy 实例, this.$wx 才是小程序的实例
No branches or pull requests
let query = wx.createSelectorQuery().in(this)
let _this = this
console.log(query.select)
query.select('#move-box').boundingClientRect(function (rect) {
console.log(rect)
_this.maxWidth = rect.width
console.log(_this.maxWidth)
}).exec(res => {
console.log(res)
})
ready生命周期中,在子组件获取元素高度, 控制台
An SelectorQuery call is ignored because no proper page or component is found. Please considering using
SelectorQuery.in
to specify a proper one.如果不使用in(this), 获取的rect是null
The text was updated successfully, but these errors were encountered: