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

以后可不敢轻易升级了

posted @ 2020-09-10 16:45  博客圆萌主  阅读(8229)  评论(5编辑  收藏  举报
个人博客 | 个人短链接平台