当前位置: 代码迷 >> 综合 >> Property or method “toJSON“ is not defined on the instance but referenced during render.
  详细解决方案

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

热度:49   发布时间:2023-11-18 12:41:36.0

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.
翻译:属性或方法“toJSON”未在实例上定义,但在呈现过程中被引用。通过初始化属性,确保此属性是被动的,无论是在data选项中,还是对于基于类的组件。参见:https://vuejs.org/v2/guide/reactivity.html声明-反应特性。

解决方案:在vue的实例methods里面定义一个toJSON(){}函数即可解决

  相关解决方案