Uniapp/小程序 Property or method "toJSON" is not defined


如图,刚更新微信开发者工具,结果原来的项目就报错:

[Vue warn]: Property or method "toJSON" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. 

大致意思是当前的vue实例没有toJSON这个属性/方法,这好办啊,我灵机一动,直接手动在methods里面加了这个方法,如下:

...
methods: {
      ...
      toJSON () {},
      ...
}
...

果然,控制台的错误没有了,但是canvas画不出来了,坑爹啊!!!网上尝试了各种方式都不行,最后下载了一个老版本的微信开发者工具,居然好了!!!

下的是这个版本:https://developers.weixin.qq.com/community/develop/doc/0000c4f9440410caa11ab51cd5b801

以后可不敢轻易升级了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM