【发布时间】:2020-09-11 13:16:22
【问题描述】:
我有一个数组(它不是最终版本,数组是动态的)
[{
"TemplateName": "C__01",
"Template": "<div><h1>Hello world!</h1><div id='C__01__body'></div></div>",
"TemplateBody": "body",
"TemplateChildren": [{
"TemplateName": "C__02",
"Template": "<p>Hello1</p>",
"TemplateBody": null,
"TemplateChildren": [{
"TemplateName": "C__03",
"Template": "<p>Hello2</p>",
"TemplateBody": null,
"TemplateChildren": [{
"TemplateName": "C__04",
"Template": "<p>Hello3</p>",
"TemplateBody": null,
"TemplateChildren": null
}, {
"TemplateName": "C__05",
"Template": "<p>Hello4</p>",
"TemplateBody": null,
"TemplateChildren": null
}]
}]
}]
}];
我不是在找字段,我只需要在数组中映射每个数组
【问题讨论】:
-
映射数组中的每个数组是什么意思?你选择了什么方法?
-
我想为数组中的每个数组做类似
array.map()的事情 -
你能提供你需要的样本输出吗?
-
你好。我不需要输出。我需要更改
innerHTML以使用数组中的字段值。因为我需要为数组中的每个数组做array.map()
标签: javascript arrays web frontend web-frontend