• Welcome to the eight year blog, I'm glad to meet you at the right age!
  • Due to the theme, QQ login partners will display the default avatar in the comments. Please go to the personal center and upload the avatar again.

The SelectAll component cannot be used by the applet

Code Notes barben 6 months ago (05-06) 265 views 0 comments

Shocked! Encapsulating a component, using Wx. Createselectorquery(). Selectall(). Boundingclientrect() to get an empty array!?

The solution is unexpected, which makes people feel sad. Xiaobian takes a breath of cold air after learning, and can't speak on the spot!

Add the .in(this) that will do

 const query = wx.createSelectorQuery().in(this);
  query.selectAll(".area-item").boundingClientRect((rect) => {
    console.log(rect);
}).exec();


Eight blogs that year, we've been there all the time
If the author does not indicate the original article, please indicate the link and source of this article
Applet component cannot get node using SelectAll - https://www.barben.cn/code/814.html
Like it( two )
Post my comments
Cancel comment
expression Mapping Bold Strikethrough Center Italics

You need to bring your nickname and email with you in the year of eight!

  • Nickname (required)
  • Email address (required)
  • website