- 当前 Bug 的表现(可附上截图)
控制台警告信息 Node "#menu" is not found. Intersection observer will not trigger.
- 预期表现
tabbar页面或栈内页面应该能正常执行createIntersectionObserver相关操作
- 复现路径
- 提供一个最简复现 Demo
request({
url: 'xxxx',
success: res => {
wx.createIntersectionObserver().relativeToViewport({ top: -40 }).observe('#menu', res => {
this.setData({ menuFixed: !res.intersectionRatio });
});
}
})
// 当前页面执行request并在success的callback中使用createIntersectionObserver, 在回包之前如果切换到了其它页面(原页面并未unload), 会报出该错误