处理项目(vue前端项目)监控报错的问题时发现这么一串报错信息,经排查是由于埋点数据里有个值是 ref 值但是没有加 .value
使用,因为这个 ref 值里还有另一个 ref 值,然后埋点数据会对这个值进行 JSON.stringify
处理,就报了如下报错
Converting circular structure to JSON
--> starting at object with constructor 's'
| property '_scope' -> object with constructor 't'
| property 'effects' -> object with constructor 'Array'
| index 0 -> object with constructor 't'
--- property 'vm' closes the circle
综上,使用嵌套 ref 值的时候一定要用 .value
引用值,不然会给一些函数埋坑