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