原因:对象间的属性存在相互引用
解决办法:使用插件 circular-json
npm install circular-json -D
引入:
import CircularJSON from 'circular-json'
两个重要的方法(解析与反解析):
CircularJSON.parse('转换的值')
CircularJSON.stringify('转换的值')
完美解决!
原因:对象间的属性存在相互引用
解决办法:使用插件 circular-json
npm install circular-json -D
引入:
import CircularJSON from 'circular-json'
两个重要的方法(解析与反解析):
CircularJSON.parse('转换的值')
CircularJSON.stringify('转换的值')
完美解决!