__ob__: Observer这个后缀其实是Vue监控数据产生的,如果使用push添加数据就会出现__ob__: Observer
使用 JSON.parse(JSON.stringify(dataName))可解决
this.teams.push({
'name':this.teamName,
'grade':this.teamGrade
})
console.log(JSON.parse(JSON.stringify(this.teams)))
console.log(this.teams)

本文介绍了在Vue中遇到__ob__:Observer监控数据的问题,通过使用JSON.parse(JSON.stringify())方法解决,并解释了JSON.parse()和stringify()的作用。

6353

被折叠的 条评论
为什么被折叠?



