wx.createIntersectionObserver()传this和null有什么区别?
发布于 4 年前 作者 min27 8840 次浏览 来自 问答

写代码发现传this,设置option: {thresholds: [0], initialRatio: 1}无效

而传null,有效,为什么???

2 回复

taro给出解决方案 传this.$scope,该对象是小程序的Vo对象

https://github.com/NervJS/taro/issues/4465

有新的调用方式,看下面的链接

https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createIntersectionObserver.html

用this.createIntersectionObserver([options])代替wx.createIntersectionObserver试试。

回到顶部