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

uni.createIntersectionObserver 监听多个节点时 observeAll: true, 在百度小程序中不生效,百度小程序需要传入 selectAll: true, 方可监听多个节点 #3835

Closed
yuyy opened this issue Sep 7, 2022 · 1 comment
Assignees

Comments

@yuyy
Copy link

yuyy commented Sep 7, 2022

问题描述
[问题描述:尽可能简洁清晰地把问题描述清楚]
uni.createIntersectionObserver 监听多个节点时 observeAll: true, 在百度小程序中不生效,百度小程序需要传入 selectAll: true, 方可监听多个节点

预期结果
[使用简洁清晰的语言描述你希望生效的预期结果]

let params = {
thresholds: [0.5],
observeAll: true,
};

if (isBaidu()) {
params = {
thresholds: [0.5],
selectAll: true,
};
}
const intersectionObserver = uni.createIntersectionObserver(instance, params)
.relativeToViewport();

期望不做端的区分,直接传入observeAll 即可实现在手百内也可监听多个节点

@zhenyuWang
Copy link
Contributor

zhenyuWang commented Oct 18, 2022

HBuilderX 3.6.7 已抹平写法差异
observeAll: true 在百度小程序支持监听多个节点

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