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

Cannot read property 'getContext' of null #13

Closed
1uokun opened this issue Aug 11, 2021 · 2 comments
Closed

Cannot read property 'getContext' of null #13

1uokun opened this issue Aug 11, 2021 · 2 comments

Comments

@1uokun
Copy link

1uokun commented Aug 11, 2021

小程序this.createSelectorQuery()有时候会拿不到DOM

有人推荐写在nextTick里,但还是会存在拿不到,有更好的写法吗🐶

wx.nextTick(() => {
  ...
  this.createSelectorQuery()
     .exec(res => {
            const canvas = res[0].node;
      })
  ...
}
@Gitjinfeiyang
Copy link
Owner

生命周期放的对嘛 ,之前还没遇到过这种情况🐶

@Gitjinfeiyang
Copy link
Owner

微信相关问题

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