【发布时间】:2015-12-28 22:26:46
【问题描述】:
我尝试使用节点模块(https://www.npmjs.com/package/json2xls)将 json 转换为 excel
我附上了我的示例 json 文件:
[ { "id":11, "title":"The Brain ", "keyTerms":"You should a", "visible":true, "introduction":{ "id":5336, "title":"Introductory Materials", "resources":[ { "id":22, "title":"Vocabulary - Brain and Nervous System", "description":""} ] }, "objectives":[ { "id":33, "title":"1. Describe how the nervous system is organized", "caContribution":5, "position":1, "resources":[ { "id":23024, "title":"Reading - How the Nervous System Works"} ] } ] } ]
获取excel输出:
标题: 1.身份证, 2.标题, 3.关键词, 4.可见, 5.介绍, 6.目标
结果得到了,但问题在于介绍和目标列的值只得到 [object][object],[object][object]
预期输出:
所有 json 对象的内部都应该是带有值的标题。
【问题讨论】:
-
鉴于您的示例 JSON,您希望
introduction列中包含的值是多少? -
@JackZelig - 我添加了我的示例 json 文件。请在此处查看。 jsfiddle.net/rajinikumarr/oyn5a397
-
谢谢,但这仍然不能回答我的问题:)