typescript Json Convert

关键代码

this.data={};
// json string
this.dataStr=JSON.stringify(this.data);
// json object
this.convertData=JSON.parse(this.dataStr);

示例代码

示例代码

参考资料

TypeScript: Working with JSON

原文地址:https://www.cnblogs.com/Lulus/p/9483025.html