onReady() {
console.log('[pages/tabbar/home/index]:onReady')
observer = uni
.createIntersectionObserver(this, { thresholds: [0.95, 0.98, 1] })
.relativeToViewport({ top: -44 })
.observe('.u-sticky-wrap', res => {
console.log(res)
})
}
- 发布:2021-01-28 13:56
- 更新:2021-02-03 11:24
- 阅读:1012
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: macOS Big Sur 11.1
手机系统: iOS
手机系统版本号: IOS 14
手机厂商: 苹果
手机机型: iPhone 12
页面类型: nvue
打包方式: 云端
项目创建方式: CLI
CLI版本号: 2.0.0-30720210122001
示例代码:
操作步骤:
nvue 页面使用 uni.createIntersectionObserver
nvue 页面使用 uni.createIntersectionObserver
预期结果:
不报错
不报错
实际结果:
报错
报错
bug描述:
nvue 页面在App内使用 uni.createIntersectionObserver 报错
13:49:31.259 [ERROR] : TypeError: JSON.stringify cannot serialize cyclic structures. __ERROR
2 个回复
DCloud_UNI_Anne
https://uniapp.dcloud.io/nvue-api?id=nvue-%e9%87%8c%e4%b8%8d%e6%94%af%e6%8c%81%e7%9a%84-uni-app-api
像素方舟_青阳 (作者)
补充一下规避方案
https://weex.apache.org/zh/docs/events/common-events.html#appear
https://weex.apache.org/zh/docs/modules/dom.html#dom