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

编程入门 行业动态 更新时间:2024-10-27 22:33:09

Uniapp/小<a href=https://www.elefans.com/category/jswz/34/1771429.html style=程序 Property or method “toJSON“ is not defined"/>

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画不出来了,坑爹啊!!!网上尝试了各种方式都不行,最后下载了一个老版本的微信开发者工具,居然好了!!!

下的是这个版本:

以后可不敢轻易升级了


最新版已经已经修复该问题:

更多推荐

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

本文发布于:2024-02-11 16:47:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1682086.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   Property   Uniapp   defined   toJSON

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!