uni - app - Property or method “toJSON“ is not defined on the instance but referenced during render.

忘是亡心i 2022-11-19 12:52 350阅读 0赞

完整报错

  1. ## SEO
  2. [Vue warn]: Property or method "toJSON" is not defined on the instance but referenced during render.
  3. Make sure that this property is reactive, either in the data option, or for class-based components,
  4. by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

在这里插入图片描述

解决方法

在当前报错页面,methods 方法中加入以下代码:

  1. toJSON(){ }

如下示例(什么都不需要写):
在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,350人围观)

还没有评论,来说两句吧...

相关阅读