Vue错误——Property or method "toJSON" is not defined on the instance but referenced during re

Posted 苏云南雁

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vue错误——Property or method "toJSON" is not defined on the instance but referenced during re相关的知识,希望对你有一定的参考价值。

我的vue在注册过程中报了这个错误:

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.

而且影响了router的传值。

很奇怪的是引起这个问题的原因在于,在于在生命周期的created方法中报错:

  created()
    console.log('created');
    console.log(this);
    // console.log('params:' + JSON.stringify(this.$route.params));
  ,

一旦去掉console.log(this)就能解决这个问题

为什么会出现这个问题?后续研究研究

以上是关于Vue错误——Property or method "toJSON" is not defined on the instance but referenced during re的主要内容,如果未能解决你的问题,请参考以下文章

[Vue warn]: Property or method "list" is not defined on the instance but referenced during

vue.runtime.esm.js?a593:619 [Vue warn]: Property or method “value“ is not defined on the instance...

解决控制台报错:Property or method “showInfo“ is not defined on the instance but referenced during render

解决控制台报错:Property or method “showInfo“ is not defined on the instance but referenced during render

错误信息:Bean property 'sessionFactory' is not writable or has an invalid setter method.(Springm

vuex报错:Property or method “$store“ is not defined on the instance but referenced during render. Make