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

如何获取完成的页面上h2w__mark节点位置,并滚动到这个位置?使用wx.createSelectorQuery返回null #286

Open
zcqebm opened this issue Jul 17, 2024 · 5 comments

Comments

@zcqebm
Copy link

zcqebm commented Jul 17, 2024

0 (1)
0

@sbfkcel
Copy link
Owner

sbfkcel commented Jul 22, 2024

@zcqebm
Copy link
Author

zcqebm commented Jul 23, 2024

换了this.createSelectorQuery,组件内的还是null,组件外添加的ABC能找到。
微信截图_20240723104018
微信截图_20240723104052

@sbfkcel
Copy link
Owner

sbfkcel commented Jul 25, 2024

整个 render 是异步的。尝试在计时器(例如:20秒后)里面来获取呢?

@Axingx
Copy link

Axingx commented Aug 9, 2024

请问你解决了吗 这个问题

@zcqebm
Copy link
Author

zcqebm commented Aug 13, 2024

没有解决。
事实上我是在页面上添加了2个浮动按钮来执行这个查询位置并滚动到这个位置的动作。
所以页面渲染完成后等多久点击按钮都可以,然而都会报错。
为了对比,我在towxml之后增加了一个view,class标记ABC。
1

选择这个ABC的话,是可以滚动到底部的
2

但是towxml组件内就是不行
3

后来我找到这篇帖子
https://developers.weixin.qq.com/community/develop/doc/000c0a1fdb03a8572189327c251400?highLine=createSelectorQuery
并按照帖子里面的写法做了调整
4

似乎返回了位置,但看query的结果,我认为并没有成功。

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

3 participants