使用 uni-app 框架进行开发,编译到微信小程序端时出现如下报错:

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'n'
| property '_events' -> object with constructor 'n'
| property '@room/client-banned' -> object with constructor 'r'
--- property 'context' closes the circle
at JSON.stringify (<anonymous>)
at cloneWithData (vender.js?178:8572)
logmp.runtime.esm.js 中的 cloneWithData,对 vue 的 data 序列化使用的序列化方法为 JSON.parse(JSON.stringify()) 。如果在 vue 组件的 data 里挂载 RTC 实例,由于实例继承了 EventEmitter3 对象,因此无法通过上述方法序列化。
建议将 RTC 实例挂载到 vuex 的 store 里。