使用 uview 的Waterfall组件报了这错,但是程序正常执行
在官网拷贝的示例代码中找不到toJSON,于是去找源码的问题,发现
const contentObserver = uni.createIntersectionObserver(this);
源码里这句话注释掉就不报错,当然程序就不会渲染出瀑布流中的图片了。所以组合百度了
uni.createIntersectionObserver(this) Property or method "toJSON" is not defined on the instance but
根据他人的提示,我试着在uview官网Waterfall demo 的data中添加一个toJSON属性,结果就不报错了。程序照样正常运行,也有人说换开发工具的版本,我就不折腾了。
这是官网demo
这是我的
多了toJSON属性。