• 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 applet component cannot get the node using SelectAll

Code Notes barben 3 months ago (05-06) 143 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();


We've been blogging that year
If the article and the author are not noted, please reprint it
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