キャッチされない例外TypeError:JSONに円形構造の変換

与えられた理由

検出JSON.stringifyオブジェクトOBJ(OBJ)再帰参照(オブジェクト自体の属性値を参照)を行います

// 问题代码 -- 注意这里有互相引用的问题
this.param = this.contract[this.index]
this.param.list = this.contract

ソリューション

割り当てが使用されJSON.parse(JSON.stringify())たデータ間の相互参照を遮断します

// 修改后的代码
this.param = JSON.parse(JSON.stringify(this.contract[this.index]))
this.param.list = JSON.parse(JSON.stringify(this.contract))

おすすめ

転載: www.cnblogs.com/codebook/p/12152682.html