uniapp项目报错
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
项目里也没有用到toJSON的方法呀
网上说的解决办法在methods 里加一个toJSON的方法,很奇怪,我都没用到怎么还要加,果然加了也不管用。
最后 去掉console.log() 打印的信息,就不报错了
据说是打印的时候还没得到数据, 我也不知道为啥
接上--------
可能是我代码写的console.log(this.
r
e
f
s
.
x
x
x
)
,
r
e
f
是循环出来的,在循环里其实是个数组。改成
t
h
i
s
.
refs.xxx),ref是循环出来的,在循环里其实是个数组。 改成this.
refs.xxx),ref是循环出来的,在循环里其实是个数组。改成this.refs[0].xxx就好了