starting at object with constructor ‘Watcher‘ | property ‘vm‘ -> object with constructor ‘Vu

使用了Vue 2.7,之前我是用 getCurrentInstance 然后直接获取的store 下面的 userId,后面加了一个 computed 。我以为computed 是和之前一样的就没改接口请求,然后就报错,其实 computed 返回的参数和 ref 是一样的需要 .value。

心得总结:

当出现 Converting circular structure to JSON
–> starting at object with constructor ‘Watcher’
| property ‘vm’ -> object with constructor ‘VueComponent’
| property ‘_scope’ -> object with constructor ‘EffectScope’
| property ‘effects’ -> object with constructor ‘Array’
— index 0 closes the circle
有 vm 、_scope、effects、Watcher 发生错误可能就是 Vue2.7 和 Vue3 ref 之类的需要 .value才能拿到真实的值。

总结

当请求接口出生出错:
1: 先查看参数是否正确。
2: 查看 axios 的 request 的值。
3: 如果 network 没有请求接口 大部分应该在 请求参数的时候就错误了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值