395 Star 3.4K Fork 660

GVPuCharts / uCharts

 / 详情

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

已完成
任务
创建于  
2020-02-16 10:24

该问题是怎么引起的?

将线性图样例 http://doc.ucharts.cn/1172181 插入我的 uniapp 项目,图能正常显示出来,但会导致我的页面上其它内容都显示不出来。不插入图的时候没问题。

该问题在浏览器上看 h5 版本没问题,但在安卓 app 里会出问题。

从报错信息上看,跟对某个对象进行JSON序列化JSON.stringify有关,该对象可能有自引行为。

重现步骤

报错信息

报错信息:

null:613 [Vue warn]: 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. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

(found in my-pages/record/view)
null:5630 TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    --- property '_renderProxy' closes the circle
    at JSON.stringify (<anonymous>)
    at cloneWithData (null:5615)
    at VueComponent.patch [as __patch__] (null:5628)
    at VueComponent.Vue._update (null:3965)
    at VueComponent.updateComponent (null:5696)
    at Watcher.get (null:4425)
    at Watcher.run (null:4500)
    at flushSchedulerQueue (null:4256)
    at Array.eval (null:1990)
    at flushCallbacks (null:1918)

评论 (1)

zhiqiang.org 创建了任务
zhiqiang.org 关联仓库设置为uCharts/uCharts
zhiqiang.org 修改了描述
展开全部操作日志

https://ask.dcloud.net.cn/question/73642 找到了解决办法。要用全局变量,不能绑定在 Vue 对象上。

zhiqiang.org 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(1)
JavaScript
1
https://gitee.com/uCharts/uCharts.git
git@gitee.com:uCharts/uCharts.git
uCharts
uCharts
uCharts

搜索帮助

14c37bed 8189591 565d56ea 8189591